mirror of
https://github.com/dg/dibi.git
synced 2025-08-09 23:56:58 +02:00
removed IConnection (BC break)
This commit is contained in:
@@ -21,7 +21,7 @@ use const PHP_SAPI;
|
|||||||
* @property-read int $affectedRows
|
* @property-read int $affectedRows
|
||||||
* @property-read int $insertId
|
* @property-read int $insertId
|
||||||
*/
|
*/
|
||||||
class Connection implements IConnection
|
class Connection
|
||||||
{
|
{
|
||||||
/** function (Event $event); Occurs after query is executed */
|
/** function (Event $event); Occurs after query is executed */
|
||||||
public ?array $onEvent = [];
|
public ?array $onEvent = [];
|
||||||
|
@@ -178,63 +178,3 @@ interface Reflector
|
|||||||
*/
|
*/
|
||||||
function getForeignKeys(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;
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user