sshilko/php-sql-mydb

PHP client for MySQL database

https://github.com/sshilko/php-sql-mydb

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.8%) to scientific vocabulary

Keywords

mysql php
Last synced: 6 months ago · JSON representation

Repository

PHP client for MySQL database

Basic Info
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
mysql php
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Codeowners Security Authors Dco

README.md

MyDb - Component

Project status - active Latest Stable Version Total Downloads PHP Required Version MIT License Psalm Coverage Code size
PHPUnit coverage PHPUnit classes coverage PHPUnit lines coverage PHPUnit methods coverage
8.1 Phan build 8.1 Psalm build 8.1 PHPMd build 8.1 PHPStan build 8.1 PHPCodeSniffer build 8.1 PHPDocumentor build 8.1 Pdepend build 8.1 PHPUnit build 8.0 PHPUnit build 8.1 PHPUnit build 8.2 PHPUnit build GithubPages build

Simple PHP client for MySQL database

Installation

composer require sshilko/php-sql-mydb

Compatibility

  • PHP 8.0, 8.1, 8.2
  • MySQL >=5.7.8, 8.0
  • MariaDB not compatible (TODO)

How this client helps you talk SQL to MySQL server

  • Make MySQL behave like a “traditional” SQL database system
  • Friendly transactions
  • Explicit timeouts
    • 05 seconds client-side connect-timeout
    • 89 seconds server-side SELECT query timeout
    • 90 seconds client-side read-timeout for any query
    • 7200 seconds non-interactive connection idle timeout
    • mysqlnd.net_read_timeout
    • respect client disconnect in php-fpm function.ignore-user-abort.php
  • Performance boost
    • increased MYSQLI_OPT_NET_READ_BUFFER_SIZE
    • increased MYSQLI_OPT_NET_CMD_BUFFER_SIZE
    • read-only InnoDB optimizations
    • READ COMMITED session transaction isolation level for readonly connections
    • async command execution
    • move mysql resultset to PHP userspace memory MYSQLI_STORE_RESULT_COPY_DATA
    • use of fetch_all from PHP Mysql native driver
  • UTF-8
    • utf8mb4 character set
    • UTC timezone
  • Quality error handling
    • PHP default error-reporting E_ALL & ~E_WARNING & ~E_NOTICE
    • MySQL default error-reporting MYSQLI_REPORT_ALL ^ MYSQLI_REPORT_STRICT ^ MYSQLI_REPORT_INDEX
    • SIGTERM, SIGINT, SIGHUP signals trap
    • connection retry
  • PHPUnit & Static code analysis
    • unit-tested, static analysed codebase

What is the best use-case for this library

  • High performance, low-latency data-intensive applications
  • No prepared statements requirement
  • No 3rd party dependencies
  • No run-time/compile-time steps
  • Easy to start with and/or integrate into existing codebase

Out of scope

This library is not intending to become a framework, to keep focus and minimize codebase, it does not provide

please re-use existing solutions that best fit your requirements.

Why this library exists

  • MySQL database is fast, reliable and scalable, php runtime is the same
  • Value developers time and do not add complexity where possible
  • Measure app's performance with real-world datasets and organic load
  • Optimize for my use-case, focus on bottlenecks, remember that there is no ~~NoSQL~~ silver bullet
  • Do not optimize early - resources like CPU, memory are cheap
  • Focus on building architecture, learn from others and improve over time

Future roadmap

  • MariaDB compatibility layer (variables and init command syntax is different between mysql and mariadb)
  • MydbFactory responsible for initializing defaults

Contributing

Authors

Sergei Shilko contact@sshilko.com

Owner

  • Name: Sergei
  • Login: sshilko
  • Kind: user
  • Location: Berlin
  • Company: fulltime at @messagebird.com

GitHub Events

Total
  • Push event: 907
Last Year
  • Push event: 907

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 245
  • Total Committers: 1
  • Avg Commits per committer: 245.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 16
  • Committers: 1
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Sergei Shilko c****t@s****m 245
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • packagist 4 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
packagist.org: sshilko/php-sql-mydb

Simple yet powerful PHP wrapper for MySQL

  • License: MIT
  • Latest release: 2.0.0
    published about 2 years ago
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 4 Total
Rankings
Dependent packages count: 19.1%
Forks count: 27.9%
Dependent repos count: 33.4%
Stargazers count: 38.0%
Average: 41.1%
Downloads: 87.1%
Maintainers (1)
Funding
  • url: https://paypal.me/sergeishilko: type: custom
  • url: https://github.com/sshilko: type: github
Last synced: 6 months ago

Dependencies

composer.json packagist
  • phpmd/phpmd ^2.13 development
  • phpstan/phpstan * development
  • phpunit/phpunit ^9 development
  • psalm/phar * development
  • slevomat/coding-standard ^8.4 development
  • squizlabs/php_codesniffer * development
  • ext-ctype *
  • ext-mysqli *
  • ext-mysqlnd *
  • php >=7.4
  • psr/log ^1