Deployment
MountSQLI is a normal Node library. Deploy it like any TypeScript backend.
Node / Bun
Section titled “Node / Bun”pnpm build # your apppnpm start # node dist/server.jsUse the Postgres or MySQL driver in production to avoid the Node ≥ 22.5 requirement of the zero-dep SQLite driver (or run Node 22.5+).
Docker
Section titled “Docker”FROM node:22-alpineWORKDIR /appCOPY . .RUN corepack enable && pnpm install --frozen-lockfile && pnpm buildCMD ["node", "dist/server.js"]Environment & config
Section titled “Environment & config”Keep secrets in the environment, not in code:
const db = mountsqli({ driver: "postgres", url: process.env.DATABASE_URL!, tables: [users],});Run migrations as a deploy step:
mountsqli migrate applyStudio is dev-only
Section titled “Studio is dev-only”Don’t expose mountsqli dev / Studio to the public internet. Serve your API with
a real server; keep Studio for local use.
Best practices
Section titled “Best practices”- Apply migrations in CI/deploy before starting the app.
- Use
PgTokenStore/createPgAdapterfor sessions in production. - Inject a shared
RateLimiter(Redis) for multi-instance login protection.
Common mistakes
Section titled “Common mistakes”- Deploying with the SQLite
:memory:driver (data lost on restart). - Exposing Studio publicly.
Related
Section titled “Related”- Drivers → Postgres — production DB.
- Sessions — production token store.
- Testing — how to verify before deploy.
