Download the PHP package phpnomad/sqlite-integration without Composer
On this page you can find all versions of the php package phpnomad/sqlite-integration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpnomad/sqlite-integration
More information about phpnomad/sqlite-integration
Files in phpnomad/sqlite-integration
Package sqlite-integration
Short Description PDO+SQLite implementation of phpnomad/db strategies. Pairs with phpnomad/mysql-integration so entity classes and repositories are portable between MySQL (server) and SQLite (desktop/local).
License MIT
Homepage https://github.com/phpnomad/sqlite-integration
Informations about the package sqlite-integration
phpnomad/sqlite-integration
phpnomad/sqlite-integration implements phpnomad/db's query builders and table strategies for SQLite via PDO. It opens its own connection (configured by DSN), generates SQLite-flavored SQL, and exposes the same strategy interfaces that phpnomad/mysql-integration does — so entity classes, repositories, and validation are portable between MySQL and SQLite.
The intended use case is the local-storage half of a desktop app whose server uses phpnomad/mysql-integration. Same models on both sides, only the strategy binding differs.
Installation
What This Provides
- A
QueryBuilderandClauseBuilderthat emit SQLite-flavored SQL for SELECT, JOIN, GROUP BY, ORDER BY, LIMIT, OFFSET, and the full set of comparison operators (including IS NULL, IN, BETWEEN, and AND/OR groups) QueryStrategy,TableCreateStrategy,TableDeleteStrategy,TableExistsStrategy, andTableUpdateStrategyimplementations covering insert, update, delete, query, estimated count, and schema managementTableUpdateStrategy::syncColumnshandles SQLite's limited ALTER — simple ADD/DROP COLUMN for the common case, transactional create-copy-drop-rename for affinity changesPdoDatabaseStrategy— a PDO-backedDatabaseStrategythat parses SafeMySQL-style placeholders (?n,?s,?i,?d,?a) so the builders speak the same language as the MySQL pipelineConnection— a thin PDO wrapper that turns on foreign keys and WAL journaling by defaultDatabaseDateAdapterthat round-tripsDateTimethrough the sameY-m-d H:i:sformat the MySQL adapter uses- A
Databasefacade exposingparse(),query(), andlastInsertId()for the boundDatabaseStrategy
Requirements
- PHP 8.3+ with
pdoandpdo_sqliteextensions phpnomad/dbphpnomad/loader ^1.0 || ^2.0
This package supplies its own DatabaseStrategy (PdoDatabaseStrategy) — unlike phpnomad/mysql-integration, you do not need a separate driver package.
Usage
Add Initializer to your bootstrapper. The integration registers every builder, strategy, and adapter listed above.
By default the integration opens an in-memory database. Point it at a file by setting PHPNOMAD_SQLITE_DSN:
Handlers in phpnomad/db will then resolve QueryStrategy, QueryBuilder, ClauseBuilder, and the table strategies from this package.
SQLite vs MySQL
The strategy layer is dialect-aware; everything above it is not. A few practical differences to know about:
- No
AUTO_INCREMENTkeyword. UseINTEGER PRIMARY KEY(rowid alias) or passAUTOINCREMENTas a column attribute for strictly-monotonic ids. The MySQLAUTO_INCREMENTattribute is translated automatically. - Type affinity, not types.
VARCHAR(255)andTEXTare the same thing in SQLite. MySQL types (BIGINT,LONGTEXT,DATETIME,BOOLEAN, etc.) are mapped to SQLite-canonical equivalents inCREATE TABLE. - Limited
ALTER TABLE. Adding and dropping columns work directly. Changing a column's type affinity triggers a transactional rebuild handled byTableUpdateStrategy. LIKEis case-insensitive by default for ASCII. SetPRAGMA case_sensitive_like = 1if your app needs MySQL-like behavior.- No
ENGINE=InnoDB/CHARACTER SET=table options. Silently dropped.
Testing
The test suite covers placeholder semantics, query construction, clause composition, table lifecycle, schema migration, value safety against SQL injection, type translation, and full-stack scenarios.
Documentation
The phpnomad/db documentation at phpnomad.com covers table schemas, handlers, and how the query building pipeline fits together.
License
MIT License. See LICENSE.txt.
All versions of sqlite-integration with dependencies
ext-pdo Version *
ext-pdo_sqlite Version *
phpnomad/db Version ^2.0
phpnomad/datastore Version ^2.0
phpnomad/di Version ^2.0
phpnomad/facade Version ^1.0
phpnomad/loader Version ^1.0 || ^2.0
phpnomad/singleton Version ^1.0
phpnomad/utils Version ^1.0