k-kinzal / sql-semantics-sqlite
SQLite statement models, SQL reconstruction, and schema binding for SQL Semantics
Requires
- php: ^8.1
- k-kinzal/sql-parser: dev-main
- k-kinzal/sql-semantics: dev-main
Requires (Dev)
- brianium/paratest: ^7.3
- deptrac/deptrac: ^3.0
- fakerphp/faker: ^1.23
- friendsofphp/php-cs-fixer: ^3.95.25
- k-kinzal/lemon-parser: dev-main
- k-kinzal/php-ai-toolkit: dev-main
- k-kinzal/sql-faker: dev-main
- k-kinzal/sql-formatter: dev-main
- nikic/php-fuzzer: ^0.0.11
- phpbench/phpbench: ^1.4
- phpcompatibility/php-compatibility: ^10.0.0-alpha2
- phpstan/phpstan: ^2.1
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^10.5
- squizlabs/php_codesniffer: ^4.0.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-28 02:33:09 UTC
README
SQL Semantics for SQLite adds SQLite to SQL Semantics: the typed statement models of the official SQLite grammars, the SQLite rules for reading declarations, and the SQLite builder that composes values under stable names. Installing it also installs the shared SQL Semantics runtime, and Dialect::Sqlite selects SQLite in the runtime's Semantics. 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; 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, traversal, dependencies, and composition.
License
MIT License. See LICENSE for details.