Skip to content

Commit

Permalink
removed IConnection (BC break)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 3, 2024
1 parent 632a776 commit 303fd86
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 61 deletions.
2 changes: 1 addition & 1 deletion src/Dibi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
60 changes: 0 additions & 60 deletions src/Dibi/interfaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 303fd86

Please sign in to comment.