hgraca/micro-dbal

此包已被弃用且不再维护。没有建议的替代包。

一个轻量级的PHP DBAL客户端

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

PHP DBAL客户端

待办事项:项目简要描述。这应该解释项目是什么。 待办事项:项目创建和维护的动机简要描述。这应该解释项目存在的原因。

使用方法

待办事项:如何使用项目的简要说明。这应该解释项目如何使用。在项目中将以下内容安装后,您可以轻松使用CRUD客户端,即

$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']);

或者原始客户端,即

$rawClient = new PdoClient(new PDO($dsn);

$rawClient->executeQuery($sql, $bindingsList);
$rawClient->executeCommand($sql, $bindingsList);

安装

要安装库,运行以下命令,您将获得最新版本

composer require hgraca/micro-dbal

测试

要运行测试,运行

make test

或者以下任何一个

make test-acceptance
make test-functional
make test-integration
make test-unit
make test-humbug

要调试模式运行测试,运行

make test-debug

覆盖率

要生成测试覆盖率,运行

make coverage

代码规范

要修复代码规范,运行

make cs-fix

待办事项