Open source · MIT · Pure PHP

libSQL for PHP,
over plain HTTP.

Turso Client HTTP speaks Hrana over HTTP — no native extension, no FFI. Use Turso Cloud or self-hosted sqld from anywhere ext-curl works.

use Darkterminal\TursoHttp\LibSQL;

$db = new LibSQL(
    "libsql://db-org.turso.io",
    ["authToken" => $token]
);

$rows = $db->query(
    "SELECT name FROM users WHERE active = ?",
    [1]
)->fetchArray(LibSQL::LIBSQL_ASSOC);

The libSQL workflow, in pure PHP

Install with Composer, connect over HTTP, and use a familiar PHP API. Same client for Turso Cloud and self-hosted sqld.

Pure PHP, Hrana over HTTP

No compiled extension, no FFI. The client speaks libSQL's Hrana protocol over HTTP through ext-curl, so it runs in environments where native extensions are not an option.

Familiar API

query(), execute(), prepare(), transaction(), and fetch modes that feel natural in PHP.

Builders included

Fluent query builder and schema builder for common CRUD and table operations, backed by the same HTTP pipeline.

Cloud, local, and Laravel

Point the same code at Turso Cloud or a self-hosted libsql-server. The package also ships a Laravel service provider and facade with auto-discovery.

Install in one command

Composer package. No extension compile, no php.ini change.

shell
 composer require darkterminal/turso-client-http

Before you run it

  • PHP 8.3+ with ext-curl, ext-json, ext-mbstring
  • A Turso Cloud database or self-hosted sqld
  • No native libSQL extension required

After install

  • Create a LibSQL client with your database URL
  • Run queries, prepared statements, builders, or transactions
  • Read the user manual for the full API
— Stars
— Contributors
latest Latest release

Open source, pure PHP

Turso Client HTTP is MIT licensed and built in the open. The docs in this repository are the source of truth.

View on GitHub

Need the full picture?

The user manual covers configuration, builders, transactions, Laravel, and deployment.