Skip to content

SQLite

Drizby supports SQLite via two providers.

A synchronous, file-based SQLite driver. Drizby automatically applies WAL mode and foreign key pragmas on connection.

Connection string:

file:data/mydata.sqlite
FieldExample
File pathfile:data/analytics.sqlite

The database file is created automatically if it doesn’t exist.

For Turso — an edge-optimized SQLite fork. Uses structured connection fields.

FieldRequiredDescription
URLYesLocal file path or remote Turso database URL
Auth TokenNoRequired for remote Turso databases

Local example: file:data/local.db

Remote example: libsql://your-db-name.turso.io

SQLite schemas use sqliteTable and column types from drizzle-orm/sqlite-core:

import { sqliteTable, integer, text, real } from 'drizzle-orm/sqlite-core'
export const events = sqliteTable('events', {
id: integer('id').primaryKey({ autoIncrement: true }),
name: text('name').notNull(),
value: real('value'),
category: text('category'),
createdAt: integer('created_at', { mode: 'timestamp' })
})
  • SQLite is the default engine for the demo database created on first startup.
  • Drizby’s internal database also uses SQLite (via better-sqlite3).