final class SqliteErrorClassifier
    implements ErrorClassifier
Public API: explicitly declared with @visibility public.

SQLite-specific error classifier.

Classifies SQLite error codes to determine the type of error. SQLite uses SQLITE_ERROR (1) for general SQL errors including unknown columns and tables. More specific codes are available via extended error codes.

Recognize a missing table from a driver exceptiondoctest
$classifier = new \ZtdQuery\Platform\Sqlite\Connection\SqliteErrorClassifier();
    $error = new \ZtdQuery\Connection\Exception\DatabaseException("no such table: users", 1);
    $classifier->isUnknownSchemaError($error) // => true

Methods§

public function isUnknownSchemaError(DatabaseException $e): bool
Public API: explicitly declared with @visibility public.

{@inheritDoc}

Parameters

Returns

bool
Distinguish missing schema from other SQLite errorsdoctest
$classifier = new \ZtdQuery\Platform\Sqlite\Connection\SqliteErrorClassifier();
    $error = new \ZtdQuery\Connection\Exception\DatabaseException("no such table: users", 1);
    $classifier->isUnknownSchemaError($error) // => true
    $classifier->isUnknownSchemaError(new \ZtdQuery\Connection\Exception\DatabaseException("syntax error", 1)) // => false
Test cases 11
Calls 5

Private surface 1§

Implementation details, listed for orientation only.

private const SQLITE_ERROR = 1

Test cases 11§

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

Dedicated tests 11