1
0
mirror of https://github.com/dg/dibi.git synced 2025-02-21 09:23:57 +01:00

removed IConnection (BC break)

This commit is contained in:
David Grudl 2024-09-03 15:58:35 +02:00
parent 5d035ec2f3
commit dea50c9e5e
2 changed files with 1 additions and 61 deletions

View File

@ -19,7 +19,7 @@ use Traversable;
* @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 = [];

View File

@ -178,63 +178,3 @@ interface Reflector
*/
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;
}