db

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package db opens an app's SQLite database per docs/adr/0007-sqlite-per-app-litestream.md: one file per app under the data directory, WAL mode, embedded migrations applied on open.

The driver is modernc.org/sqlite (pure Go): deploys cross-compile with CGO_ENABLED=0 (docs/adr/0011-split-host-deployment.md).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(slug string, migrations fs.FS) (*sql.DB, error)

Open opens data/<slug>.db, creating the data directory if needed, and applies any unapplied migrations from the app's embedded migrations FS (files named NNNN_*.sql, applied in lexical order, tracked via PRAGMA user_version). Pass nil for an app with no schema.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL