- How do I install darkterminal/turso-http in a Laravel application?
- Install it with composer require darkterminal/turso-http. Laravel package auto-discovery registers the service provider, so you can then publish the config file with php artisan vendor:publish and add your Turso credentials to the environment file. No native extension or PDO driver compilation step is required.
- Does darkterminal/turso-http require the libsql-php extension or a PDO driver?
- No. The package talks to Turso's HTTP data API over plain HTTPS using curl or Guzzle, so it works on any PHP 8 host without libsql-php, pdo_sqlite, or any other native extension. That makes it a good fit for constrained runtimes such as serverless functions, shared hosting, and CI jobs where installing extensions is painful.
- Which PHP and Laravel versions does darkterminal/turso-http support?
- The package targets PHP 8 and modern Laravel versions with package auto-discovery. Before adopting it, read the composer.json constraints to confirm the exact PHP, Laravel, and Guzzle versions declared, and check that none of those dependencies are abandoned. Because it is a small community package, version constraints may lag behind the newest Laravel release.
- How do I configure the Turso database URL and auth token?
- After publishing the config file, set the Turso database URL (or database name) and auth token as environment variables such as TURSO_DATABASE_URL and TURSO_AUTH_TOKEN. The client resolves these through Laravel's config layer, so keep them out of source control and set them per environment. If you need token rotation, verify whether the package reads the token on each request or only at boot.
- Is darkterminal/turso-http a Laravel database driver for Eloquent?
- No, and this is a deliberate scope choice. It is a low-level data-plane HTTP client, not a Laravel database connector, so it will not transparently route Eloquent models or DB::table() calls through Turso. Teams expecting PDO-style ergonomics will be disappointed; teams wanting an RPC-style query client will be satisfied.
- Can I run transactions or batch queries with Turso over HTTP?
- Turso's HTTP API is oriented toward batched statement execution rather than interactive, session-bound transactions. Workflows that depend on long-lived transactions, SELECT ... FOR UPDATE, or multi-round-trip isolation generally need to be re-architected as atomic batches or avoided. Confirm that the package exposes the batch or pipeline semantics you need before committing to it.
- How does darkterminal/turso-http handle results and errors?
- Responses arrive as JSON over HTTPS and are mapped to PHP types by the client, so type fidelity depends on how carefully that mapping is done for your columns. Errors do not surface as PDO or Doctrine exceptions, which means upstream Laravel exception handlers may need adjustment. Wrap calls in your own error handling if you need consistent retry or logging behavior.
- Is darkterminal/turso-http suitable for production and serverless deployments?
- It is a reasonable fit for read-heavy, edge-adjacent workloads such as config, feature flags, catalogs, and background jobs touching reference data, especially on Vapor, Bref, or other serverless runtimes. Be aware that every call is an HTTPS round trip, so per-query overhead dominates unless you batch requests and avoid N+1 patterns. The package is also maintained by a single author with a small star count, so plan a fork or raw-HTTP fallback.
- How should I handle Turso auth token rotation with this client?
- Start by checking whether the client resolves the auth token from config on each request or captures it once when the service is bound. If it reads per request, you can rotate the token by updating the config or environment value at runtime. If it does not, wrap the client in a small factory or service that rebuilds it with a fresh token.
- What are the alternatives to darkterminal/turso-http and how do I test it?
- Alternatives include the native libsql-php extension, a full ORM/DBAL driver, or simply calling Turso's HTTP API with raw Guzzle requests—the wrapper is thin enough that replacing it in a day is realistic. Because the transport is plain HTTP, you can test it with PHPUnit and Guzzle's mock handler without touching a real database. Before adopting it, benchmark round-trip latency from your actual runtime and region against a concrete SLO.