packagek-kinzal/sql-semantics-sqlite
SQLite statement models, SQL reconstruction, and schema binding for SQL Semantics
Repository github.com/k-kinzal/ztd-query-php
Depends on k-kinzal/sql-parser, k-kinzal/sql-semantics, k-kinzal/lemon-parser require-dev, k-kinzal/sql-faker require-dev, k-kinzal/sql-formatter require-dev
Namespaces§
| SqlSemantics\Platform\Sqlite | 5 classes 1 enum |
| SqlSemantics\Statement\Model\Sqlite\Choice | 24 enums |
| SqlSemantics\Statement\Model\Sqlite\Contract | 1 class |
| SqlSemantics\Statement\Model\Sqlite\Role | 135 interfaces |
| SqlSemantics\Statement\Model\Sqlite\Value | 315 classes |
Documents 1§
| SQL Semantics for SQLite | README.md |
README§
SQL Semantics for SQLite
License: MIT Docs PHP Version Ask DeepWiki
SQL Semantics for SQLite adds SQLite to SQL Semantics: the typed statement models of the official SQLite grammars and the SQLite rules for schema binding. Installing it also installs the shared SQL Semantics runtime, and Dialect::Sqlite selects SQLite in the runtime's Semantics, Schema, and Binder. No database connection is needed.
Requirements
- PHP 8.1+ with the zlib extension
Support Syntax
The following grammar versions are supported. Pass the version tag as the second argument of Semantics or the third argument of Schema; omitting it uses the default.
| Version | Version tag | Default |
|---|---|---|
| 3.47.2 | sqlite-3.47.2 | Yes |
Installation
composer require k-kinzal/sql-semantics-sqlite
Usage
use SqlSemantics\Facade\Semantics;
use SqlSemantics\Platform\Sqlite\Dialect;
$statement = (new Semantics(Dialect::Sqlite))->analyze("INSERT OR REPLACE INTO users (id, name) VALUES (1, 'Alice')");
$statement->toString(); // "INSERT OR REPLACE INTO users( id , name ) VALUES( 1 , 'Alice' )"
See the SQL Semantics documentation for statement models and schema binding.
License
MIT License. See LICENSE for details.