Repository navigation
Connection Types
Imam Ali Mustofa edited this page Nov 10, 2026
·
1 revision
Four connection modes. All four are exercised by the test suite and/or the
docker/proof/ harness.
DB_CONNECTION=libsql
DB_DATABASE=:memory:Classic SQLite behaviour in memory. Used by most feature tests
(tests/Feature/* against :memory:).
DB_CONNECTION=libsql
DB_DATABASE=database.sqliteNo auth token or sync URL needed. tests/Feature/LocalRemoteReplicaTest.php
and the embedded replica flow in docker/proof/ both write to a local file.
DB_CONNECTION=libsql
DB_AUTH_TOKEN=<token>
DB_SYNC_URL=<url>No local file — traffic goes over HTTPS to Turso Cloud. Verified live against a real Turso Cloud database (query round-trip + probe tables cleaned up).
DB_CONNECTION=libsql
DB_DATABASE=database.sqlite
DB_AUTH_TOKEN=<token>
DB_SYNC_URL=<url>
DB_SYNC_INTERVAL=5
DB_READ_YOUR_WRITES=trueReads hit the local file; writes go through the replica which syncs with the
primary. DB::sync() triggers a manual sync.
Verified by:
-
tests/Feature/LocalRemoteReplicaTest.php(in CI against seeded sqld on 8082), -
docker/proof/(replicaphases: bootstrap pull, local journaled writes,sync()drain, second-client read-back).
- libsql URLs use the
libsql://…scheme. Plainhttp://…URLs intotursodatabaseare not accepted by this driver (Laravel treatshttp://as an unknown driver). - Remote connections require the database URL; plain
http://127.0.0.1:8080to a self-hosted sqld works only when paired withDB_SQLD_OFFLINE_MODE/ offline-write configuration.