hostsqlitedb

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type ListPrimaryAgentsParams

type ListPrimaryAgentsParams struct {
	Backend    string
	ProjectDir string
	WorktreeID string
}

type PrimaryAgent

type PrimaryAgent struct {
	Backend           string
	ProjectDir        string
	WorktreeID        string
	PrimaryAgentsJson string
	UpdatedAt         int64
}

type Querier

type Querier interface {
	DeleteSession(ctx context.Context, id string) error
	// Removes every session belonging to a worktree. Used when a worktree is
	// deleted (full cleanup), alongside removing its materialized ~/work/<id>.
	DeleteSessionsByWorktree(ctx context.Context, worktreeID string) error
	FindSessionByExternalID(ctx context.Context, externalID string) (Session, error)
	GetSession(ctx context.Context, id string) (Session, error)
	ListPrimaryAgents(ctx context.Context, arg ListPrimaryAgentsParams) (string, error)
	ListSessions(ctx context.Context) ([]Session, error)
	// Used by session-sync to enumerate sessions in a worktree for export.
	// worktree_id is the host-minted worktree ULID; cross-machine stable identity.
	ListSessionsByWorktree(ctx context.Context, worktreeID string) ([]Session, error)
	// Filtered list. Empty filter values are treated as "no filter" by
	// the query (NULL/empty matches anything for that column). Visibility
	// filter is exact match.
	SearchSessions(ctx context.Context, arg SearchSessionsParams) ([]Session, error)
	UpsertPrimaryAgents(ctx context.Context, arg UpsertPrimaryAgentsParams) error
	UpsertSession(ctx context.Context, arg UpsertSessionParams) error
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, id string) error

func (*Queries) DeleteSessionsByWorktree

func (q *Queries) DeleteSessionsByWorktree(ctx context.Context, worktreeID string) error

Removes every session belonging to a worktree. Used when a worktree is deleted (full cleanup), alongside removing its materialized ~/work/<id>.

func (*Queries) FindSessionByExternalID

func (q *Queries) FindSessionByExternalID(ctx context.Context, externalID string) (Session, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, id string) (Session, error)

func (*Queries) ListPrimaryAgents

func (q *Queries) ListPrimaryAgents(ctx context.Context, arg ListPrimaryAgentsParams) (string, error)

func (*Queries) ListSessions

func (q *Queries) ListSessions(ctx context.Context) ([]Session, error)

func (*Queries) ListSessionsByWorktree

func (q *Queries) ListSessionsByWorktree(ctx context.Context, worktreeID string) ([]Session, error)

Used by session-sync to enumerate sessions in a worktree for export. worktree_id is the host-minted worktree ULID; cross-machine stable identity.

func (*Queries) SearchSessions

func (q *Queries) SearchSessions(ctx context.Context, arg SearchSessionsParams) ([]Session, error)

Filtered list. Empty filter values are treated as "no filter" by the query (NULL/empty matches anything for that column). Visibility filter is exact match.

func (*Queries) UpsertPrimaryAgents

func (q *Queries) UpsertPrimaryAgents(ctx context.Context, arg UpsertPrimaryAgentsParams) error

func (*Queries) UpsertSession

func (q *Queries) UpsertSession(ctx context.Context, arg UpsertSessionParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type SearchSessionsParams

type SearchSessionsParams struct {
	Q          string
	Visibility string
	Since      interface{}
	Until      interface{}
	Lim        int64
}

type Session

type Session struct {
	ID             string
	ExternalID     string
	Backend        string
	Status         string
	Visibility     string
	FollowUp       int64
	ProjectDir     string
	WorktreeID     string
	WorktreeBranch string
	Prompt         string
	Title          string
	TicketID       string
	Agent          string
	Draft          string
	CreatedAt      int64
	UpdatedAt      int64
	LastReadAt     sql.NullInt64
	Subdir         string
	DisplayName    string
	Config         string
}

type UpsertPrimaryAgentsParams

type UpsertPrimaryAgentsParams struct {
	Backend           string
	ProjectDir        string
	WorktreeID        string
	PrimaryAgentsJson string
	UpdatedAt         int64
}

type UpsertSessionParams

type UpsertSessionParams struct {
	ID             string
	ExternalID     string
	Backend        string
	Status         string
	Visibility     string
	FollowUp       int64
	ProjectDir     string
	WorktreeID     string
	WorktreeBranch string
	Subdir         string
	DisplayName    string
	Prompt         string
	Title          string
	TicketID       string
	Agent          string
	Draft          string
	Config         string
	CreatedAt      int64
	UpdatedAt      int64
	LastReadAt     sql.NullInt64
}

Jump to

Keyboard shortcuts

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