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 fail-fast SQLite settings for hook, broker, worker, and background paths that retry or defer work on lock contention.
func UserFacingOpenOptions ¶ added in v0.5.2
func UserFacingOpenOptions() OpenOptions
UserFacingOpenOptions returns patient SQLite settings for commands where a user is waiting for a local result. These commands can race with the post-commit worker's writer lock, so they wait longer than hook and worker paths before returning SQLITE_BUSY.