clearsoft / easysql-connectors-sqlite
EasySQL SQLite connector package — local schema introspection and SELECT execution for SQLite files.
Package info
github.com/Clearsoft-net/easysql-php-connectors-sqlite
pkg:composer/clearsoft/easysql-connectors-sqlite
v3.3.0
2026-10-11 04:04 UTC
Requires
- php: >=8.2
- ext-pdo: *
- ext-pdo_sqlite: *
- clearsoft/easysql-common: ^3.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
SQLite connector for the EasySQL PHP SDK — local schema introspection and SELECT execution.
Installation
composer require clearsoft/easysql-connectors-sqlite
Requirements: PHP >= 8.2, ext-pdo, ext-pdo_sqlite.
Usage
use Clearsoft\EasySQL\Connectors\SQLite\ConnectionConfig; use Clearsoft\EasySQL\Connectors\SQLite\Connector; $connector = new Connector(new ConnectionConfig( path: '/var/data/shop.db', // or ':memory:' (default) readOnly: true, // default false timeout: 10.0, // seconds, default )); $connector->connect(); try { $raw = $connector->introspect(); // raw shape for the schema-generation package $result = $connector->execute('SELECT * FROM users LIMIT 10'); } finally { $connector->close(); }
Behavior
- Introspection reads
sqlite_master(excludessqlite_%internals) +PRAGMA table_info/PRAGMA foreign_key_listper table; row counts viaCOUNT(*)(best effort,nullon failure). It produces the shared raw shape (engine, engine-nativedataType, andordinal) consumed byclearsoft/easysql-schema-generation. - Execution accepts SELECT/WITH/EXPLAIN/SHOW only; prepared statements; typed rows.
- Read-only mode opens the database with
SQLITE_OPEN_READONLY— writes are rejected by the driver. - No global state — the database is opened per connection.
Tests
./vendor/bin/phpunit --testsuite connectors-sqlite
Tests use a temp-file fixture database (created in setUp, removed in tearDown) plus :memory: cases —
no external service required.