Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ public function transactionRollback(): void
$this->rollBack();
}

#[\Override]
public function hasOpenTransactions(): bool
{
return $this->numberOfOpenTransactions > 0;
Expand Down Expand Up @@ -810,6 +811,7 @@ public function getTables(?string $prefix = null): array
* @throws ConnectionException
* @deprecated
*/
#[\Override]
public function getColumnsOfTable(string $tableName): array
{
if (!$this->hasTable($tableName)) {
Expand Down Expand Up @@ -1298,6 +1300,7 @@ public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $
/**
* Method to flush the query-cache.
*/
#[\Override]
public function flushQueryCache(): void
{
$this->queryCache = [];
Expand All @@ -1308,6 +1311,7 @@ public function flushQueryCache(): void
* Since the tables won't change during regular operations,
* flushing the tables cache is only required during package updates / installations.
*/
#[\Override]
public function flushTablesCache(): void
{
$this->tablesCache = [];
Expand All @@ -1319,6 +1323,7 @@ public function flushTablesCache(): void
*
* @throws ConnectionException
*/
#[\Override]
public function flushPreparedStatementsCache(): void
{
if (!$this->connected) {
Expand Down Expand Up @@ -1375,6 +1380,7 @@ public function isConnected(): bool
* method unifies the behaviour. In order to select a column, which contains a backslash you need to escape the value
* with this method.
*/
#[\Override]
public function escape(mixed $value): mixed
{
return $this->dbDriver->escape($value);
Expand Down
15 changes: 15 additions & 0 deletions src/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,19 @@ public function getJsonColumnExpression(string $column, string $key): string;
* @return string The generated SQL snippet.
*/
public function getNthLastElementFromSlug(string $column, int $position): string;

public function flushQueryCache(): void;

public function flushTablesCache(): void;

public function flushPreparedStatementsCache(): void;

/**
* @return array<string,array{columnName:string,columnType:DataType}>
*/
public function getColumnsOfTable(string $tableName): array;

public function escape(mixed $value): mixed;

public function hasOpenTransactions(): bool;
}
33 changes: 33 additions & 0 deletions src/MockConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,37 @@ public function getNthLastElementFromSlug(string $column, int $position): string
{
return '';
}

#[Override]
public function flushQueryCache(): void
{
}

#[Override]
public function flushTablesCache(): void
{
}

#[Override]
public function flushPreparedStatementsCache(): void
{
}

#[Override]
public function getColumnsOfTable(string $tableName): array
{
return [];
}

#[Override]
public function escape(mixed $value): mixed
{
return $value;
}

#[Override]
public function hasOpenTransactions(): bool
{
return false;
}
}
Loading