Documentation
¶
Index ¶
- func Close(h *Handle) error
- func EnsureRepository(ctx context.Context, q *sqldb.Queries, rootPath string) (string, error)
- func MigratePath(ctx context.Context, dbPath string) error
- func NullInt64(v int64) sql.NullInt64
- func NullStr(s string) sql.NullString
- func ResolveCheckpointID(ctx context.Context, q *sqldb.Queries, repoID, id string) (string, error)
- func ResolveSessionID(ctx context.Context, q *sqldb.Queries, repoID, id string) (string, error)
- func RollbackTx(tx *sql.Tx)
- type Handle
- type OpenOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureRepository ¶
func MigratePath ¶
MigratePath opens a temporary connection, runs migrations, and closes it. Used by tests that need a migrated DB without a full Handle.
func NullStr ¶
func NullStr(s string) sql.NullString
NullStr returns a valid sql.NullString if s is non-empty, otherwise null.
func ResolveCheckpointID ¶
ResolveCheckpointID resolves a (possibly abbreviated) checkpoint ID to its full UUID. If id is already 36 characters it is treated as an exact match via GetCheckpointByID. Otherwise, the prefix is matched against the repository's checkpoints; an error is returned when zero or more than one checkpoint matches.
func ResolveSessionID ¶
ResolveSessionID resolves a (possibly abbreviated) session ID to its full UUID. Mirrors ResolveCheckpointID but queries agent_sessions.
func RollbackTx ¶
Types ¶
type OpenOptions ¶
func DefaultOpenOptions ¶
func DefaultOpenOptions() OpenOptions
DefaultOpenOptions returns the standard options used by most callers: BusyTimeout 250ms, Synchronous "NORMAL".