tursodatabase/turso-driver-laravel
Laravel database driver for Turso (libSQL) that lets your app use Turso's SQLite-compatible embedded and remote databases through Laravel's native DB layer. Add a connection and keep using Eloquent, migrations, and the query builder with edge-friendly, replicated SQLite storage.
Architecture fit. Laravel's database layer is built around PDO. This package is a community driver that routes Eloquent and the query builder to Turso/libSQL via native libSQL (FFI against the libsql C library) rather than a standard PDO extension. That is a meaningful departure from Laravel's expected connector model. It fits cleanly only if the project is already committed to Turso as a primary or replica store; for teams on MySQL/Postgres, it introduces a second dialect and connection path with no clear payoff. It also sits awkwardly with conventional PHP-FPM request lifecycles — each request must establish a native libSQL handle, and there is no built-in pooling, so the latency benefit of embedded/native access partially erodes under standard shared-nothing PHP hosting.
Integration feasibility. Surface-level integration is straightforward: Composer install, service provider registration, and a connections entry in config/database.php. Real feasibility depends on driver completeness — schema builder, migrations, transactions, prepared statements, and JSON/column handling must all be exercised before trusting it. FFI must be enabled (frequently disabled on managed hosting), and a native libsql binary must be present and compatible with the target OS/architecture (glibc vs musl, x86 vs ARM). This is a non-trivial deployment constraint compared with a pure-PHP PDO driver.
Technical risk. High relative to maturity signals: 98 stars, "community SDK" labeling, and a low overall score indicate a small maintainer base and limited production exposure. Risks include: incomplete Eloquent/schema-builder parity; transaction semantics over HTTP/libSQL differing from SQLite's local guarantees; FFI security and portability; binary distribution and version drift with the upstream libsql library; and no vendor-backed SLA. Laravel version compatibility is another moving target — major framework upgrades can strand the driver.
Key questions.
QueryExceptions?Stack fit. Best fit is a Laravel application targeting Turso as an edge or read-heavy datastore — for example, a Laravel app deployed to Vapor/Lambda or a read-replica pattern where low-latency reads near users matter. It is a poor fit for write-heavy transactional workloads, teams standardized on MySQL/Postgres, or environments where FFI and native binaries are prohibited. It also fits greenfield projects that accept SQLite-dialect constraints from day one.
Migration path. Treat this as an additive capability rather than a lift-and-shift. Phase 1: stand up Turso as a secondary/read datastore or reporting replica and validate the driver in isolation. Phase 2: exercise a full slice of the app — migrations, Eloquent relationships, raw queries, transactions — against a staging copy. Phase 3: only if all green, evaluate primary-store use for low-write domains. Moving an existing MySQL/Postgres app wholesale is not advisable without a dialect audit: types, auto-increment behavior, JSON functions, full-text search, and generated columns all diverge.
Compatibility. Assume SQLite dialect semantics. Laravel's SQLite grammar may cover much of the query builder, but verify schema builder output, UPSERT, RETURNING, and date/time handling. Confirm the package's declared Laravel/PHP matrix, and pin versions. Check whether it coexists with other connections in the same app so you can run Turso alongside the incumbent database during evaluation.
Sequencing.
Maintenance. This is the dominant cost. A community driver means the team owns upgrade risk: Laravel major releases, PHP minor releases, and upstream libsql changes can each break the integration. Budget for periodically vendoring or forking the driver, and for maintaining a compatibility test suite in CI. The MIT license permits this, which is the package's strongest operational asset.
Support. No commercial support path. Issue response depends on volunteer maintainers with a small user base, so triage times are unpredictable. Internal runbooks should assume self-sufficiency: ability to read the driver source, patch it, and ship a fork. Escalation to Turso is not assured for a third-party SDK.
Scaling. Turso's model scales reads via replicas and centralizes writes; the driver inherits those characteristics. From PHP, per-request native connections add overhead and connection-count pressure on the primary. Write throughput will be bounded by the single-writer architecture — fine for many read-heavy apps, a hard ceiling for write-heavy ones. Plan capacity around read locality gains, not write scaling.
Failure modes. Expect and instrument for: FFI disabled or extension missing at boot; native library absent or architecture-mismatched in a new container image; connection timeouts surfaced as generic exceptions; transaction failures with ambiguous commit state; partial driver implementation causing silent query differences; schema drift from incomplete migration support; lock contention on writes; and abandoned upstream causing a Laravel upgrade block. Each should have an explicit detection and rollback story.
Ramp-up. Moderate. Engineers need working knowledge of libSQL/Turso's architecture (replicas, embedded replicas, write routing) beyond standard Laravel DB usage. The driver's internals are a new debugging surface, so at least one engineer should own it. Given the low opportunity signal, the pragmatic TPM stance is a time-boxed spike with explicit go/no-go gates — adopt only where the edge/read-latency case is concrete and the team can absorb fork maintenance.
How can I help you explore Laravel packages today?