sqlite

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AccountsTableSchema = `` /* 746-byte string literal not displayed */

AccountsTableSchema is the SQL schema for the accounts table

Variables

This section is empty.

Functions

func CreateAccountsTable

func CreateAccountsTable(db database.Database) error

CreateAccountsTable creates the accounts table

func New

func New(cfg *Config) (database.Database, error)

New creates a new SQLite database connection

func NewInMemory

func NewInMemory() (database.Database, error)

NewInMemory creates an in-memory SQLite database

Types

type Config

type Config struct {
	// Path to the database file (:memory: for in-memory)
	Path string

	// Mode: ro (read-only), rw (read-write), rwc (read-write-create), memory
	Mode string

	// Cache: shared or private
	Cache string

	// Enable foreign keys
	ForeignKeys bool

	// Journal mode: DELETE, TRUNCATE, PERSIST, MEMORY, WAL, OFF
	JournalMode string

	// Busy timeout in milliseconds
	BusyTimeout int
}

Config represents SQLite-specific configuration

func DefaultConfig

func DefaultConfig(path string) *Config

DefaultConfig returns a Config with sensible defaults

Jump to

Keyboard shortcuts

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