final class SqliteSessionFactory
    implements SessionFactory
Public API: explicitly declared with @visibility public.

Factory for creating Session instances pre-configured for SQLite.

Create a session for a custom connectiondoctest
$connection = new class implements \ZtdQuery\Connection\ConnectionInterface { public function query(string $sql): \ZtdQuery\Connection\StatementInterface|false { return false; } };
    $session = (new \ZtdQuery\Platform\Sqlite\SqliteSessionFactory())->create($connection, new \ZtdQuery\Config\ZtdConfig());
    $session->rewrite("SELECT 1")->sql() // => 'SELECT 1'

Methods§

public function create(ConnectionInterface $connection, ZtdConfig $config): Session
Public API: explicitly declared with @visibility public.

{@inheritDoc}

Parameters

Returns

Create a session when the connection has no reflected tablesdoctest
$connection = new class implements \ZtdQuery\Connection\ConnectionInterface { public function query(string $sql): \ZtdQuery\Connection\StatementInterface|false { return false; } };
    $session = (new \ZtdQuery\Platform\Sqlite\SqliteSessionFactory())->create($connection, new \ZtdQuery\Config\ZtdConfig());
    $session->isEnabled() // => true
    $session->rewrite('SELECT 1')->sql() // => 'SELECT 1'
Test cases 29
Calls 24

Test cases 32§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4
Other tests reaching this symbol 28

Relations§

Constant reads 1