SQLite
@mountsqli/driver-sqlite uses Node’s built-in node:sqlite. It has zero
external dependencies.
Install & use
Section titled “Install & use”pnpm add @mountsqli/driver-sqliteimport "@mountsqli/driver-sqlite";import { mountsqli } from "@mountsqli/core";
const db = mountsqli({ driver: "sqlite", url: ":memory:", tables: [users] });URL forms
Section titled “URL forms”| URL | Behavior |
|---|---|
:memory: |
fresh in-memory DB, per process |
./app.db |
file-backed, persists _mount_migrations |
Bool decoding
Section titled “Bool decoding”bool() columns are stored as 0/1. The driver decodes them to boolean on
read using type info carried in the plan, so you always get true/false.
Best for
Section titled “Best for”- Local development and tests (fast, no setup).
- Edge/serverless where you want zero deps.
- Scripts and CLIs.
Best practices
Section titled “Best practices”- Use a file URL in apps so migrations persist.
- Use
:memory:for tests and one-off scripts. - Keep the Node version at ≥ 22.5 in CI.
Common mistakes
Section titled “Common mistakes”- Running migrations against
:memory:then wondering where they went. - Deploying on Node < 22.5 with this driver.
Related
Section titled “Related”- Drivers → Overview — all drivers.
- Postgres — when you need a server DB.
