db

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MigrationsFS embed.FS

MigrationsFS holds Atlas migration files. Embed the entire directory so it works even when no migrations exist yet.

Functions

func ConfigureDB added in v0.8.0

func ConfigureDB(db *sql.DB) error

ConfigureDB enables WAL mode and foreign keys on an existing *sql.DB. This is useful when multiple packages need to share the same connection.

func OpenDB

func OpenDB(dbPath string) (*sql.DB, error)

OpenDB opens a SQLite database at the given path, configures it (WAL mode, foreign keys) and runs migrations. The parent directory is created if it doesn't exist.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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