Skip to content

createLibsqlStorage

function createLibsqlStorage(options): LibsqlLinksStorage;

Defined in: src/storage/libsql.ts:60

Create a libSQL/Turso-backed LibsqlLinksStorage. The table is created on first use (a failed DDL is retried on the next call); connection (when constructed from url) is lazy and shared.

Parameter Type
options LibsqlStorageOptions

LibsqlLinksStorage

import { createLibsqlStorage } from "@xtandard/links/storage/libsql";
const storage = createLibsqlStorage({
url: process.env.TURSO_DATABASE_URL!,
authToken: process.env.TURSO_AUTH_TOKEN,
});
// process.on("SIGTERM", () => storage.close());