Repository navigation
Verification
How we prove what this package claims.
composer install
./vendor/bin/pest- 60 tests, 103 assertions — all green, plus 2 live Turso Cloud tests (11 assertions) which run when cloud credentials are set.
- The suite re-seeds a pristine database at bootstrap (drops all tables,
recreates schema from
tests/_files/database/01_create_table.sql, inserts the fixture files in sorted order, then createsartists_backup). - Verified repeatedly from a completely empty database (drop-all first).
-
TURSO_HTTP_SKIP_SEED=1 ./vendor/bin/pestskips the seed (e.g. smoke runs). - The suite expects
libsql-serveron127.0.0.1:8081by default; override withDB_URL/DB_TOKEN. CI provisions a seeded sqld service container automatically.
tests/Feature/TursoCloudConnectionTest.php runs against a real Turso Cloud
database when both variables are set (skipped otherwise, e.g. in CI):
TURSO_CLOUD_DB_URL=libsql://<db>-<org>.turso.io
TURSO_CLOUD_DB_TOKEN=<token>What they cover:
- connectivity +
SELECT sqlite_version()(3.47.0observed), - typed round trip through the Hrana v3 codec (
int/float/text/NULL), - transactions (
deferredcommit visible aftercommit(), not afterrollback()).
Each test creates and drops its own table (turso_http_cloud_proof_<rand>)
and always attempts cleanup in finally, so it is safe to run repeatedly
against the same cloud database.
.github/workflows/tests.yml on every push to main and on PRs:
| PHP | Result |
|---|---|
| 8.3 | ✅ |
| 8.4 | ✅ |
| 8.5 | ✅ |
composer.lock resolves against PHP 8.3 (config.platform.php = 8.3), so
all three legs install the same dependency set. The Turso Cloud tests skip
in CI (no credentials there).
Fresh Laravel 12 skeleton → this package installed via a path repository → one artisan command asserts five things (service provider discovery, facade resolution, connectivity, facade round trip, transaction commit):
PROOF-LARAVEL: {"ok":5,"fail":0,"all_ok":true, ...}
Green on PHP 8.3 / 8.4 / 8.5:
docker/laravel-proof/proof.sh # all three
docker/laravel-proof/proof.sh 8.4 # one versionNon-2xx responses (401 / 403 / 404) throw a catchable
Darkterminal\TursoHttp\core\LibSQLError carrying the server's error
message when present (e.g. HTTP 404: route not found: ["version"] for the
sqld-only-/version endpoint on Turso Cloud). They are never silently
returned as data.
- Offline / journaled-write modes against Turso Cloud or sqld — out of scope, not supported (see Known Limitations).
- DATETIME conversion across every possible stored format — only the exact
Y-m-d H:i:s+ known timezone path is code-verified. -
DB_STRICT_QUERY=trueexplain paths — present in code, not covered by the test suite.