Documentation
¶
Overview ¶
Package storage owns SQLite open/PRAGMA/migration plumbing and the minimal Tx interface projectors use. Nothing outside this package should import database/sql directly except cmd/* wiring.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Migrate ¶
Migrate applies a caller-provided embed.FS of goose SQL migrations. Exposed so registry can run its own migration set after Open returns. Each label gets its own goose_db_version_<label> table so migration sets don't collide.
Types ¶
type Config ¶
type Config struct {
Path string // absolute path to .db file; use ":memory:" for tests
}
type Lockfile ¶
type Lockfile struct {
// contains filtered or unexported fields
}
Lockfile holds an exclusive PID file for the daemon.
func AcquireLockfile ¶
AcquireLockfile writes <dataDir>/gohomed.lock with the current PID. Returns an error if a live process already owns the file.
type Tx ¶
type Tx interface {
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}
Tx is the transactional surface projectors work against. *sql.Tx satisfies this interface directly; test fakes can substitute.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package migrations embeds eventstore SQL migrations for goose.
|
Package migrations embeds eventstore SQL migrations for goose. |