Skip to content

createLibsqlStorage

function createLibsqlStorage(options): LibsqlAuditStorage;

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

Create a libSQL/Turso-backed LibsqlAuditStorage. The tables are created on first use; connection (when constructed from url) is lazy and shared.

Parameter Type
options LibsqlStorageOptions

LibsqlAuditStorage

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