stable

turso

Turso / libSQL adapter for noy-db — hosted SQLite with multi-region replication, using the same table and DDL as to-sqlite.

@noy-db/to-turso · pnpm add @noy-db/to-turso Hosted libSQL (SQLite fork) with multi-region replication.

Shaperecord
Atomic CAS✓
Localitycloud
Speedmedium
Persistencedurable

What it does

Wraps @libsql/client through a small async shim that speaks the same noy-db store contract as sqlite, using the same table and DDL — moving from a local SQLite file to Turso is a factory swap, nothing else changes.

Notes

  • casAtomic: true, same mechanism as to-sqlite (UPDATE … WHERE _v = ?), natively async over libSQL.
  • Record shape, one row per record.
  • Factory: toTurso(options: TursoStoreOptions).

Store-locator descriptor

See store-locator descriptors for the general model. kind: 'turso', class: 'cloud'. address is { url, table? } — url is required: the connection URL used to live only inside a clientFactory closure, invisible on a persisted descriptor; putting it on address states which database a descriptor refers to. table maps to tableName. options is { autoMigrate?, clockUncertaintyMs? }. Unlike the rest of its tier, to-turso can build its own connection: binding accepts client?or clientFactory? (paired with credentials for the auth token), and resolve() throws unless one of the two is present.

import { tursoStoreDescriptor, registerTursoStore } from '@noy-db/to-turso'

const descriptor = tursoStoreDescriptor({ url: 'libsql://my-db.turso.io' })

See also