imjonos/db-adapters

dev-master 2023-10-26 12:23 UTC

This package is auto-updated.

Last update: 2024-12-26 15:02:10 UTC


README

Base database adapters

Installation

Via Composer

$ composer require imjonos/db-adapters

How to use

Supported 2 connection types:

MySQL (PDO) - \Nos\DbAdapters\MysqlDbClientAdapter::class
Clickhouse (smi2/phpclickhouse) - \Nos\DbAdapters\ClickHouseDbClientAdapter::class

For the Clickhouse also can be use \Nos\DbAdapters\MysqlDbClientAdapter::class via MySQL interface.

interface DbClientAdapterInterface
{
    public function getClient(): mixed;

    public function selectAll(string $query, array $bindings = []): array;

    public function selectOne(string $query, array $bindings = []): ?array;

    public function exec(string $query): void;

    public function save(string $table, array $data): int;

    public function showTables(): array;

    public function close(): void;
}

Contributing

Please see contributing.md for details and a todolist.

License

license. Please see the license file for more information.