hgraca / micro-dbal
A PHP lightweight DBAL client
Requires
- php: >=7.0
- hgraca/helper: ^1.2.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- humbug/humbug: ^1.0@alpha
- mockery/mockery: ^0.9
- phpunit/php-code-coverage: ~3
- phpunit/phpunit: ~5
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2023-07-30 19:16:43 UTC
README
A PHP DBAL client
TODO: A short description of what is the project. This should explain what the project is. TODO: A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.
Usage
TODO: A short explanation of how to use the project. This should explain how the project is usable. After installing this in your project, as specified below, you can easily use the CRUD client, ie:
$crudClient = new CrudClient(new PdoClient(new PDO($dsn)), new SqlQueryBuilder()); // public function create(string $table, array $data); $crudClient->create('Employees', ['EmployeeID' => '1', 'Name' => 'Maria]); // public function read(string $table, array $filter = [], array $orderBy = [], int $limit = 30, int $offset = 1): array; $crudClient->read('Employees', ['EmployeeID' => '1']); $crudClient->read('Employees', ['EmployeeID' => ['1', '2', '3']]); // public function update(string $table, array $data, array $filter = []); $crudClient->update('Employees', ['Name' => 'Josefina], ['EmployeeID' => '1']); // public function delete(string $table, array $filter = []); $crudClient->delete('Employees', ['EmployeeID' => '1']);
Or the raw client, ie:
$rawClient = new PdoClient(new PDO($dsn); $rawClient->executeQuery($sql, $bindingsList); $rawClient->executeCommand($sql, $bindingsList);
Installation
To install the library, run the command below and you will get the latest version:
composer require hgraca/micro-dbal
Tests
To run the tests run:
make test
Or just one of the following:
make test-acceptance make test-functional make test-integration make test-unit make test-humbug
To run the tests in debug mode run:
make test-debug
Coverage
To generate the test coverage run:
make coverage
Code standards
To fix the code standards run:
make cs-fix
Todo
- Implement nested transactions management
- Implement batch update