database

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(databaseURL string) (*bun.DB, error)

Connect opens a SQLite database connection with WAL mode and foreign keys enabled.

func Migrate

func Migrate(ctx context.Context, db *bun.DB, tables []interface{}, indexes []Index) error

Migrate creates tables and indexes if they don't already exist.

Types

type Index

type Index struct {
	Name  string
	Query string
}

Index represents a database index to create during migration.

Jump to

Keyboard shortcuts

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