Skip to content

rafters-studio/ledger

@rafters/ledger

Soft-delete, audit trail, and GDPR compliance for Drizzle ORM. SQLite, PostgreSQL, MySQL.

pnpm add @rafters/ledger

Peer dependency: drizzle-orm >= 0.30.0

Two entry points: @rafters/ledger for the ORM-agnostic core (context, pure helpers, GDPR utilities), and @rafters/ledger/drizzle for the Drizzle adapter (schema, createAuditedDb, query filters, logging). Dialect-specific column definitions live at @rafters/ledger/drizzle/soft-delete/sqlite, /pg, and /mysql.

Docs

Full documentation: docs/

Guide Covers
Getting Started End-to-end setup walkthrough
Soft-Delete Column helpers, query filters, automatic soft-delete, restore
Audit Trail AuditLogger, manual logging, history queries
Context AsyncLocalStorage propagation, middleware setup
GDPR purgeUserData, PII anonymization, admin preservation
Better Auth ledgerPlugin, createSoftDeleteCallback, flow control
API Reference Every export, every type, organized by subpath

License

MIT. Authored by Sean Silvius. Source: github.com/rafters-studio/ledger.

About

Soft-delete, audit trail, and GDPR compliance for Drizzle ORM

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors