sqlite

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(h *Handle) error

func EnsureRepository

func EnsureRepository(ctx context.Context, q *sqldb.Queries, rootPath string) (string, error)

func MigratePath

func MigratePath(ctx context.Context, dbPath string) error

func NullInt64

func NullInt64(v int64) sql.NullInt64

NullInt64 returns a valid sql.NullInt64 if v > 0, otherwise null.

func NullStr

func NullStr(s string) sql.NullString

NullStr returns a valid sql.NullString if s is non-empty, otherwise null.

func ResolveCheckpointID

func ResolveCheckpointID(ctx context.Context, q *sqldb.Queries, repoID, id string) (string, error)

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

func ResolveSessionID(ctx context.Context, q *sqldb.Queries, repoID, id string) (string, error)

ResolveSessionID resolves a (possibly abbreviated) session ID to its full UUID. Mirrors ResolveCheckpointID but queries agent_sessions.

func RollbackTx

func RollbackTx(tx *sql.Tx)

Types

type Handle

type Handle struct {
	DB      *sql.DB
	Queries *sqldb.Queries
}

func Open

func Open(ctx context.Context, dbPath string, opts OpenOptions) (*Handle, error)

type OpenOptions

type OpenOptions struct {
	BusyTimeout time.Duration
	Synchronous string
}

func DefaultOpenOptions

func DefaultOpenOptions() OpenOptions

DefaultOpenOptions returns the standard options used by most callers: BusyTimeout 250ms, Synchronous "NORMAL".

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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