Documentation
¶
Overview ¶
Package store is part of the Redoubt control plane. See CLAUDE.md for its role.
Package store owns the SQLite database: opening it with the right pragmas (WAL, foreign keys, busy timeout), running the embedded goose migrations at startup, and exposing the sqlc-generated query layer (internal/store/db). No other package writes SQL.
Index ¶
- func FormatTime(t time.Time) string
- func Now() string
- func ParseTime(s string) (time.Time, error)
- type Store
- func (s *Store) Close() error
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) MigrateDownTo(ctx context.Context, version int64) error
- func (s *Store) Path() string
- func (s *Store) Version(ctx context.Context) (int64, error)
- func (s *Store) WithTx(ctx context.Context, fn func(q *db.Queries, tx *sql.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTime ¶
FormatTime renders t as RFC 3339 (nanoseconds, UTC).
Types ¶
type Store ¶
Store wraps the database handle and the generated queries.
func Open ¶
Open opens (creating if needed) the SQLite database at path, applies pragmas, and runs all pending migrations. The file is created with mode 0600.
func (*Store) MigrateDownTo ¶
MigrateDownTo rolls back to the given version (0 = everything). Used by tests only.