Skip to content

Releases: phpnomad/sqlite-integration

v1.0.0

26 May 17:25

Choose a tag to compare

Initial release of phpnomad/sqlite-integration.

PDO+SQLite implementation of phpnomad/db strategies. Intended for desktop and mobile apps that ship SQLite as their production database (NativePHP, embedded scenarios), and as a backing store for fast isolated unit tests.

What's included

  • PdoDatabaseStrategy with SafeMySQL-style placeholders (?n, ?s, ?i, ?d, ?a) and PDO-quoted escaping
  • QueryStrategy, QueryBuilder, and SQLiteClauseBuilder covering SELECT, JOIN (LEFT and RIGHT), GROUP BY, ORDER BY, LIMIT, OFFSET, and the full operator set (including IS NULL, IN, BETWEEN, and AND/OR groups)
  • TableCreateStrategy with MySQL→SQLite type translation (BIGINT/LONGTEXT/DATETIME/BOOLEAN and friends), inline AUTOINCREMENT for AUTO_INCREMENT attributes, and separate CREATE INDEX statements for indices
  • TableUpdateStrategy::syncColumns with simple ADD/DROP COLUMN for the common case and a transactional create-copy-drop-rename rebuild for affinity changes
  • TableDeleteStrategy, TableExistsStrategy with proper view/index disambiguation
  • DatabaseDateAdapter matching the MySQL adapter's Y-m-d H:i:s format
  • Connection with foreign keys ON and WAL journaling by default
  • Database facade exposing parse(), query(), and lastInsertId()

Testing

161 tests / 234 assertions, all passing on PHP 8.3+ with pdo_sqlite. Coverage includes placeholder semantics, every operator on the clause builder, every public method on the query builder, table lifecycle, schema migration with data preservation, value safety against SQL injection, and full end-to-end scenarios.

Requirements

  • PHP 8.3+
  • pdo and pdo_sqlite extensions
  • phpnomad/db ^2.0