classPreparedQuery
final class PreparedQuery
Restricted visibility: declared "@visibility ZtdQuery\Adapter\Pdo". Code outside that scope must not name this declaration.
Rewrites a prepared query against the current shadow before each execution. The native preparation callback retains the caller's driver options.
Methods§
public function __construct(
private Session $session,
private string $sql,
private Closure(string): PDOStatement|false $prepare,
)Parameters
$session | Session | |
$sql | string | |
$prepare | Closure(string): PDOStatement|false | Native preparation with its original options. |
public function rewrite(): RewritePlanResolve a fresh plan after any preceding shadow mutations.
Returns
Throws
DatabaseException When the session rejects the query.Test cases 3
Called from 1
Calls 1
- method-call Session::rewrite() line 39
public function prepare(string $sql): PDOStatementPrepare the rewritten SQL using the caller's original driver options.
Parameters
$sql | string |
Returns
PDOStatementThrows
ZtdPdoException When a silent-mode driver refuses preparation.Test cases 4
Called from 1
Calls 1
Private surface 3§
Implementation details, listed for orientation only.
private Session $sessionprivate string $sqlprivate Closure(string): PDOStatement|false $prepareTest cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 11
PdoConnectionTestcallsPdoStatementTestcallsConnectionExecutionTestcallsDriverSessionFactoryTestcallsParameterBinderTestcallsStatementExecutionTest::testBindParameterRetainsReferencesAcrossRepreparationcallsStatementExecutionTest::testExecutePreparedRefreshesShadowReadsAndReplaysBindingscallsStatementExecutionTest::testResultUpdatesShadowAndReturnsItsResultcallsZtdPdoExceptionTestcallsZtdPdoStatementTestcallsZtdPdoTestcalls
Relations§
Instantiated in 1
Method calls 2
Type declarations 3
- type ZtdQuery\Adapter\Pdo\Session\StatementExecution packages/ztd-query-pdo-adapter/src/Session/StatementExecution.php:35
- type ZtdQuery\Adapter\Pdo\ZtdPdo::prepare() packages/ztd-query-pdo-adapter/src/ZtdPdo.php:171
- type ZtdQuery\Adapter\Pdo\ZtdPdoStatement packages/ztd-query-pdo-adapter/src/ZtdPdoStatement.php:54