-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce literal string for connection execute methods
- Loading branch information
1 parent
1667bda
commit 45aa443
Showing
10 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL\Cache; | ||
|
||
use Doctrine\DBAL\Exception; | ||
|
||
class CacheException extends Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL\Cache; | ||
|
||
class QueryCacheProfile | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL; | ||
|
||
class Connection | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL; | ||
|
||
class Exception extends \Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL; | ||
|
||
class Result | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL\Types; | ||
|
||
abstract class Type | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL; | ||
|
||
use Doctrine\DBAL\Cache\CacheException; | ||
use Doctrine\DBAL\Cache\QueryCacheProfile; | ||
use Doctrine\DBAL\Types\Type; | ||
|
||
class Connection | ||
{ | ||
/** | ||
* Executes an SQL statement with the given parameters and returns the number of affected rows. | ||
* | ||
* Could be used for: | ||
* - DML statements: INSERT, UPDATE, DELETE, etc. | ||
* - DDL statements: CREATE, DROP, ALTER, etc. | ||
* - DCL statements: GRANT, REVOKE, etc. | ||
* - Session control statements: ALTER SESSION, SET, DECLARE, etc. | ||
* - Other statements that don't yield a row set. | ||
* | ||
* This method supports PDO binding types as well as DBAL mapping types. | ||
* | ||
* @param literal-string $sql SQL statement | ||
* @param list<mixed>|array<string, mixed> $params Statement parameters | ||
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types | ||
* | ||
* @return int|string The number of affected rows. | ||
* | ||
* @throws Exception | ||
*/ | ||
public function executeStatement($sql, array $params = [], array $types = []); | ||
|
||
/** | ||
* Executes an, optionally parameterized, SQL query. | ||
* | ||
* If the query is parametrized, a prepared statement is used. | ||
* If an SQLLogger is configured, the execution is logged. | ||
* | ||
* @param literal-string $sql SQL query | ||
* @param list<mixed>|array<string, mixed> $params Query parameters | ||
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types | ||
* | ||
* @throws Exception | ||
*/ | ||
public function executeQuery( | ||
string $sql, | ||
array $params = [], | ||
$types = [], | ||
?QueryCacheProfile $qcp = null | ||
): Result; | ||
|
||
/** | ||
* Executes a caching query. | ||
* | ||
* @param literal-string $sql SQL query | ||
* @param list<mixed>|array<string, mixed> $params Query parameters | ||
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types | ||
* | ||
* @throws CacheException | ||
* @throws Exception | ||
*/ | ||
public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp): Result; | ||
|
||
} |