Skip to content

@xtandard/entitlements/drizzle/sqlite

SQLite Drizzle table factories: sqliteEntitlementsTable() (state KV) and sqliteCountersTable() (counters). Schema-only.

import { … } from "@xtandard/entitlements/drizzle/sqlite";
Name Summary
sqliteCountersTable Build the SQLite sqliteTable for the counter store: key text PRIMARY KEY, value real NOT NULL DEFAULT 0, applied real NOT NULL DEFAULT 0, expires_at integer (unix ms). The table name defaults to "xtandard_entitlements_counters".
sqliteEntitlementsTable Build the SQLite sqliteTable for the entitlements KV store: key text PRIMARY KEY, value text NOT NULL (JSON mode). The table name defaults to "xtandard_entitlements_kv".
Name Summary
SqliteCountersTableOptions Options for sqliteCountersTable (same knobs as the KV table).
SqliteEntitlementsTableOptions Options for sqliteEntitlementsTable and sqliteCountersTable.
Name Documented on
DrizzleCounterTable @xtandard/entitlements/counters/drizzle