Anydataset Database Relational abstraction. Anydataset is an agnostic data source abstraction layer in PHP.
MIT License
Anydataset Database Relational abstraction. Anydataset is an agnostic data source abstraction layer in PHP.
See more about Anydataset here.
The connection string for databases is based on URL.
See below the current implemented drivers:
Database | Connection String | Factory |
---|---|---|
Sqlite | sqlite:///path/to/file | getDbRelationalInstance() |
MySql/MariaDb | mysql://username:password@hostname:port/database | getDbRelationalInstance() |
Postgres | psql://username:password@hostname:port/database | getDbRelationalInstance() |
Sql Server (DbLib) | dblib://username:password@hostname:port/database | getDbRelationalInstance() |
Sql Server (Sqlsrv) | sqlsrv://username:password@hostname:port/database | getDbRelationalInstance() |
Oracle (OCI8) | oci8://username:password@hostname:port/database | getDbRelationalInstance() |
Generic PDO | pdo://username:password@pdo_driver?PDO_PARAMETERS | getDbRelationalInstance() |
<?php
$conn = \ByJG\AnyDataset\Db\Factory::getDbRelationalInstance("mysql://root:[email protected]/myschema");
Just type:
composer require "byjg/anydataset"
flowchart TD
byjg/anydataset-db --> byjg/anydataset-array
byjg/anydataset-db --> ext-pdo
byjg/anydataset-db --> byjg/uri
byjg/anydataset-db --> psr/cache
byjg/anydataset-db --> psr/log