PHPackages                             darkterminal/libsql-doctrine-dbal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. darkterminal/libsql-doctrine-dbal

Abandoned → [tursodatabase/turso-doctrine-dbal](/?search=tursodatabase%2Fturso-doctrine-dbal)ArchivedLibrary[Database &amp; ORM](/categories/database)

darkterminal/libsql-doctrine-dbal
=================================

A Doctribe DBAL Driver implementation on top of LibSQL Extension

0.0.3(1y ago)17MITPHPPHP &gt;=8.1

Since Jun 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/darkterminal/libsql-doctrine-dbal)[ Packagist](https://packagist.org/packages/darkterminal/libsql-doctrine-dbal)[ RSS](/packages/darkterminal-libsql-doctrine-dbal/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

🚨 THIS REPOSITORY IS READ-ONLY 🚨
================================

[](#-this-repository-is-read-only-)

### This repository is no longer under maintenance and has been moved to
 the official [Turso Database](https://github.com/tursodatabase) repository under the name [Turso Doctrine DBAL](https://github.com/tursodatabase/turso-doctrine-dbal)

[](#this-repository-is-no-longer-under-maintenance-and-has-been-moved-to--the-official-turso-database-repository-under-the-name-turso-doctrine-dbal)

 [ ![Turso + TypeScript](https://camo.githubusercontent.com/3e22c64aeb4da4c404a1d06735053bf3c1fff9104b5468c61c17371116ceefca/68747470733a2f2f692e696d6775722e636f6d2f723030396e32752e706e67)](https://github.com/darkterminal/libsql-doctrine-dbal)

### Turso + Doctrine DBAL

[](#turso--doctrine-dbal)

 SQLite for Production. Powered by [libSQL](https://turso.tech/libsql) and [libSQL Extension](https://github.com/darkterminal/libsql-extension) for PHP.

 [**Turso**](https://turso.tech) · [**Quickstart**](https://darkterminal.mintlify.app/dark-packages/libsql-doctrine-dbal/readme) · [**Examples**](https://darkterminal.mintlify.app/dark-packages/libsql-doctrine-dbal/readme) · [**Docs**](https://darkterminal.mintlify.app/dark-packages/libsql-doctrine-dbal/readme) · [**Discord**](https://discord.com/invite/4B5D7hYwub) · [**Blog &amp; Tutorials**](https://blog.turso.tech/)

---

A LibSQL Driver for Doctrine DBAL
=================================

[](#a-libsql-driver-for-doctrine-dbal)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/ce739667a295d942b2d1691cd1c691a9a6dad34c864252be6cb9e50be6c3e435/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461726b7465726d696e616c2f6c696273716c2d646f637472696e652d6462616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darkterminal/libsql-doctrine-dbal) [![Total Downloads](https://camo.githubusercontent.com/158c35e846caf7f5ca76e9a870c0e218b22169f3114a3c6d9e8c352dce02ffd3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461726b7465726d696e616c2f6c696273716c2d646f637472696e652d6462616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darkterminal/libsql-doctrine-dbal)

LibSQL is a fork of SQLite and this package is **\#1 LibSQL Driver** that run natively using LibSQL Native Extension/Driver/Whatever and support Doctrine DBAL.

Requirement
-----------

[](#requirement)

**Before using this package**, you need to install and configure **LibSQL Native Extension for PHP**. You can download from **[LibSQL Extension - Release](https://github.com/darkterminal/libsql-extension)**

1. 📦 Extract the archive
2. 🗃 Locate somewhere in your machine
3. 💽 Copy a relative path that address that extension/driver
4. 📂 Open `php.ini` search `;extension` if you using nano (ctrl+w) then searching for it
5. 📝 add in the next-line `extension=liblibsql_php.so` (in Linux) without `;` at the begining

Package Installation
--------------------

[](#package-installation)

```
composer require darkterminal/libsql-doctrine-dbal
```

Configuration
-------------

[](#configuration)

LibSQL has 4 types of connections to interact with the database: In-Memory Connection, Local Connection, Remote Connection, and Remote Replica Connection (Embedded Replica).

### In-Memory Connection

[](#in-memory-connection)

```
$params = [
    "url"               => ":memory:",
    'driverClass'       => \Darkterminal\LibSQL\DBAL\Driver::class,
];
```

### Local Connection

[](#local-connection)

```
$params = [
    "url"               => "database.db",
    'driverClass'       => \Darkterminal\LibSQL\DBAL\Driver::class,
];
```

If you want to create Remote Connection or Remote Replica (Embedded Replica) Connection, you will need an existing database to continue. If you don’t have one, **[create one](https://docs.turso.tech/quickstart)**.

Get the database URL:

```
turso db show --url
```

Get the database authentication token:

```
turso db tokens create
```

If you use `.env` file, assign credentials to the environment variables inside `.env`.

```
TURSO_DATABASE_URL=
TURSO_AUTH_TOKEN=
```

### Remote Connection

[](#remote-connection)

```
$params = [
    "auth_token"        => "",
    "sync_url"          => "",
    'driverClass'       => \Darkterminal\LibSQL\DBAL\Driver::class,
];
```

### Remote Replica (Embedded Replica) Connection

[](#remote-replica-embedded-replica-connection)

```
$params = [
    "url"               => "database.db",
    "auth_token"        => "",
    "sync_url"          => "",
    "sync_interval"     => 5,    // Optional, default is: 5 in seconds
    "read_your_writes"  => true, // Optional, default is: true
    "encryption_key"    => "",   // Optional, default is: empty
    'driverClass'       => \Darkterminal\LibSQL\DBAL\Driver::class,
];
```

Usage
-----

[](#usage)

```
use Doctrine\DBAL\DriverManager;

require_once __DIR__ . '/vendor/autoload.php';

$params = [
    "url"               => ":memory:",
    'driverClass'       => \Darkterminal\LibSQL\DBAL\Driver::class,
];

$db = DriverManager::getConnection($params);

$createTable = "CREATE TABLE IF NOT EXISTS users (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT,
    age INTEGER
)";
$db->executeStatement($createTable);

$insertUsers = executeQuery("SELECT * FROM users")->fetchAllAssociative();
var_dump($result);
$db->close();
```

---

Documentation
-------------

[](#documentation)

1. [Turso Quickstart](https://docs.turso.tech/quickstart) — Learn how create and connect your first database.
2. [SDK Quickstart](#) — Learn how to install and execute queries using the libSQL client.
3. [SDK Reference](#) — Dive deeper with the libSQL SDK reference and examples.

### What is Turso?

[](#what-is-turso)

[Turso](https://turso.tech) is a SQLite-compatible database built on [libSQL](https://docs.turso.tech/libsql), the Open Contribution fork of SQLite. It enables scaling to hundreds of thousands of databases per organization and supports replication to any location, including your own servers, for microsecond-latency access.

Learn more about what you can do with Turso:

- [Embedded Replicas](https://docs.turso.tech/features/embedded-replicas)
- [Platform API](https://docs.turso.tech/features/platform-api)
- [Data Edge](https://docs.turso.tech/features/data-edge)
- [Branching](https://docs.turso.tech/features/branching)
- [Point-in-Time Recovery](https://docs.turso.tech/features/point-in-time-recovery)
- [Scale to Zero](https://docs.turso.tech/features/scale-to-zero)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

715d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32319439?v=4)[Imam Ali Mustofa](/maintainers/darkterminal)[@darkterminal](https://github.com/darkterminal)

---

Top Contributors

[![darkterminal](https://avatars.githubusercontent.com/u/32319439?v=4)](https://github.com/darkterminal "darkterminal (11 commits)")

### Embed Badge

![Health badge](/badges/darkterminal-libsql-doctrine-dbal/health.svg)

```
[![Health](https://phpackages.com/badges/darkterminal-libsql-doctrine-dbal/health.svg)](https://phpackages.com/packages/darkterminal-libsql-doctrine-dbal)
```

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
