byjg / anydataset-db
Anydataset Database Relational abstraction. Anydataset is an agnostic data source abstraction layer in PHP.
Fund package maintenance!
byjg
Installs: 58 924
Dependents: 4
Suggesters: 0
Security: 0
Stars: 5
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: >=8.1 <8.4
- ext-json: *
- ext-pdo: *
- byjg/anydataset-array: ^5.0
- byjg/uri: ^5.0
- psr/cache: ^1.0|^2.0|^3.0
- psr/log: ^1.1|^2.0|^3.0
Requires (Dev)
- byjg/cache-engine: ^5.0
- phpunit/phpunit: ^9.6
- vimeo/psalm: ^5.9
Suggests
- ext-curl: *
- ext-oci8: *
- ext-pdo_mysql: *
- ext-pdo_pgsql: *
- byjg/cache-engine: ^5.0
Provides
README
Anydataset Database Relational abstraction. Anydataset is an agnostic data source abstraction layer in PHP.
See more about Anydataset here.
Features
- Connection based on URI
- Support and fix code tricks with several databases (MySQL, PostgresSql, MS SQL Server, etc)
- Natively supports Query Cache by implementing a PSR-6 interface
- Supports Connection Routes based on regular expression against the queries, that's mean a select in a table should be executed in a database and in another table should be executed in another (even if in different DB)
Connection Based on URI
The connection string for databases is based on URL.
See below the current implemented drivers:
<?php $conn = \ByJG\AnyDataset\Db\Factory::getDbInstance("mysql://root:password@10.0.1.10/myschema");
Examples
- Getting Started
- Basic Query and Update
- Cache results
- Database Transaction
- Load Balance and Connection Pooling
- Database Helper
Advanced Topics
Database Specifics
Install
Just type:
composer require "byjg/anydataset"