hgraca/micro-dbal

This package is abandoned and no longer maintained. No replacement package was suggested.

A PHP lightweight DBAL client

0.2.1 2016-12-20 23:14 UTC

This package is auto-updated.

Last update: 2023-07-30 19:16:43 UTC


README

Author Software License Latest Version Total Downloads

Build Status Coverage Status Quality Score

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