From 303fd86e9621abe0fd6d9c79e3550849df13e06f Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 3 Sep 2024 15:58:35 +0200 Subject: [PATCH] removed IConnection (BC break) --- src/Dibi/Connection.php | 2 +- src/Dibi/interfaces.php | 60 ----------------------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/src/Dibi/Connection.php b/src/Dibi/Connection.php index 916d0956..3cb40eac 100644 --- a/src/Dibi/Connection.php +++ b/src/Dibi/Connection.php @@ -19,7 +19,7 @@ * @property-read int $affectedRows * @property-read int $insertId */ -class Connection implements IConnection +class Connection { /** function (Event $event); Occurs after query is executed */ public ?array $onEvent = []; diff --git a/src/Dibi/interfaces.php b/src/Dibi/interfaces.php index 3cf33685..753d0b6e 100644 --- a/src/Dibi/interfaces.php +++ b/src/Dibi/interfaces.php @@ -178,63 +178,3 @@ function getIndexes(string $table): array; */ function getForeignKeys(string $table): array; } - - -/** - * Dibi connection. - */ -interface IConnection -{ - /** - * Connects to a database. - */ - function connect(): void; - - /** - * Disconnects from a database. - */ - function disconnect(): void; - - /** - * Returns true when connection was established. - */ - function isConnected(): bool; - - /** - * Returns the driver and connects to a database in lazy mode. - */ - function getDriver(): Driver; - - /** - * Generates (translates) and executes SQL query. - * @throws Exception - */ - function query(...$args): Result; - - /** - * Gets the number of affected rows by the last INSERT, UPDATE or DELETE query. - * @throws Exception - */ - function getAffectedRows(): int; - - /** - * Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query. - * @throws Exception - */ - function getInsertId(?string $sequence = null): int; - - /** - * Begins a transaction (if supported). - */ - function begin(?string $savepoint = null): void; - - /** - * Commits statements in a transaction. - */ - function commit(?string $savepoint = null): void; - - /** - * Rollback changes in a transaction. - */ - function rollback(?string $savepoint = null): void; -}