emonkak / database
A database abstraction interface as a subset of PDO
Installs: 219 049
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- php: >=8.1
- ext-pdo: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.56.1
- php-coveralls/php-coveralls: ^2.7
- phpunit/phpunit: ^10.5.20
- vimeo/psalm: ^5.24.0
README
This package provides a database abstraction as a subset of PDO.
API
Emonkak\Database\PDOInterface
interface PDOInterface extends PDOTransactionInterface { public function errorCode(): ?string; public function errorInfo(): array; public function exec(string $statement): int|false; public function lastInsertId(?string $name = null): string|false; public function prepare(string $query, array $options = []): PDOStatementInterface|false; public function query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatementInterface|false; public function quote(string $string, int $type = PDO::PARAM_STR): string|false; }
Emonkak\Database\PDOTransactionInterface
interface PDOTransactionInterface { public function beginTransaction(): bool; public function commit(): bool; public function inTransaction(): bool; public function rollback(): bool; }
Emonkak\Database\PDOStatementInterface
interface PDOStatementInterface extends \Traversable { public function bindValue(string|int $param, mixed $value, int $type = \PDO::PARAM_STR): bool; public function errorCode(): ?string; public function errorInfo(): array; public function execute(?array $params = null): bool; public function fetch(int $mode = \PDO::ATTR_DEFAULT_FETCH_MODE, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0): mixed; public function fetchAll(int $mode = \PDO::ATTR_DEFAULT_FETCH_MODE, mixed ...$args): array; public function fetchColumn(int $column = 0): mixed; public function rowCount(): int; public function setFetchMode(int $mode, mixed ...$args): true; }