@mayurajs/storage-libsql
v1.2.0
Published
Mayura storage on libSQL (Turso, sqld or a local file), through the official libSQL client.
Readme
@mayurajs/storage-libsql
Mayura storage on libSQL: Turso, your own sqld server, or a local file, through the official @libsql/client.
npm install mayura @mayurajs/storage-libsqlimport { createLibsqlStore } from '@mayurajs/storage-libsql';
const store = createLibsqlStore({ url: 'libsql://my-app.turso.io', authToken: process.env.TURSO_AUTH_TOKEN! });
await store.initialize();
// Hand `store` to workflow runtimes, memory, budgets and your server; close it on shutdown.- The same store as
mayura/storage-sqliteandmayura/storage-postgres: durable workflows, scheduled jobs, execution waits, durable budgets, workflow trees and native memory. It passes the same conformance suites, on a local file and against asqldserver. - SQLite's SQL and schema: a local libSQL file and a
mayura/storage-sqlitefile are interchangeable. - Every operation is one write transaction. Writes run one at a time per store; a local file locked by another process is retried for up to 5 seconds without blocking the event loop.
- The URL and token are options, never read from the environment. Plain
http://andws://are accepted only for loopback addresses, and a token in the URL is refused. - Pass
clientinstead ofurlto use a client you create and own; the store never closes it.
See the storage guide. Apache-2.0.
