db/sqlite
File-backed SQLite database via better-sqlite3, with WAL enabled and no server to run.
Provides: database, database:sql, database:sqlite
Requires: runtime:node, config:env
Conflicts with: database
Options
| Prompt | Flag | Type | Default |
|---|---|---|---|
db.name | --db-name | input | "{{ project.slug }}" |
Files it writes
src/db/client.ts|js(when!has('orm/prisma'))
Dependencies
better-sqlite3@^13.0.3(when!has('orm/prisma'))
Development only:
@types/better-sqlite3@^7.6.13(whenprovides('language:typescript') && !has('orm/prisma'))
Environment
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | yes | SQLite database file, as a file: URL |
What it contributes to other files
| File | Slot | Line |
|---|---|---|
src/config/env.ts|js | env-schema | DATABASE_URL: z.string().min(1), |
src/index.ts|js | imports | import { checkDatabaseConnection } from './db/client.js'; |
src/index.ts|js | bootstrap | checkDatabaseConnection(); |
What it merges into other files
pnpm-workspace.yaml(yaml-deep)
Use it
atarashi new my-app --add db/sqlite
atarashi add db/sqlite
Version 1.0.0. Format reference: Authoring blueprints.
Part of the atarashi documentation, written and maintained by Gautam Suthar.