Skip to content

@xtandard/audit/drizzle/sqlite

SQLite Drizzle table factories for the audit store: sqliteAuditTables() (or the per-table factories) puts the KV and event-log tables in your Drizzle schema and migrations. Schema-only.

import { … } from "@xtandard/audit/drizzle/sqlite";
Name Summary
sqliteAuditEventsTable Build the events table: PRIMARY KEY (tenant, seq), UNIQUE (tenant, id) and (tenant, occurred_at, id) / (tenant, actor_id, …) / (tenant, action, …) indexes. The name defaults to "xtandard_audit_events".
sqliteAuditEventTargetsTable Build the event-targets table (one row per distinct event target), indexed on (tenant, type, target_id, seq) and (tenant, seq). The name defaults to "xtandard_audit_event_targets".
sqliteAuditTable Build the SQLite sqliteTable for the audit KV store: key text PRIMARY KEY, value text NOT NULL (JSON mode). The table name defaults to "xtandard_audit".
sqliteAuditTables All three tables with matching names: {name}, {name}_events, {name}_event_targets.
Name Summary
SqliteAuditTableOptions Options for sqliteAuditTable.
Name Documented on
DrizzleAuditTables @xtandard/audit/drizzle/mysql
DrizzleEventsTable @xtandard/audit/drizzle/mysql
DrizzleEventTargetsTable @xtandard/audit/drizzle/mysql