Choosing a provider
Setup
- SQLite
- Postgres
- MySQL
SQLite is the default for development. No peer dependencies beyond For in-memory SQLite (tests and CI), use KavachOS enables WAL mode and foreign keys automatically:
better-sqlite3, which ships with kavachos.:memory: as the URL:Auto-migration
By default, KavachOS callsCREATE TABLE IF NOT EXISTS for all its tables on startup. This means your database is always ready to use without any manual migration step.
To disable this (e.g. when you manage migrations externally with Flyway, Liquibase, or drizzle-kit push), set skipMigrations: true:
Schema overview
KavachOS creates the following tables in your database:
All table and column names use
snake_case. All IDs are text (UUID or CUID2). Timestamps are stored as Unix seconds integers.
Peer dependencies
KavachOS uses dynamic imports for Postgres and MySQL drivers so they remain optional. You will get a clear error message at startup if the required package is missing:
Testing with in-memory SQLite
Use:memory: for fast, isolated tests that need no setup or teardown:
createKavach() call with :memory: gets a completely isolated database, so tests never share state.