postgresstore

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queries

type Queries struct {
	*dbsqlc.Queries
	// contains filtered or unexported fields
}

func NewQueries

func NewQueries(queries *dbsqlc.Queries) *Queries

func NewQueriesWithPool

func NewQueriesWithPool(pool *pgxpool.Pool, queries *dbsqlc.Queries) *Queries

func (*Queries) BindHistoryTurnAssistantByRequest

func (q *Queries) BindHistoryTurnAssistantByRequest(ctx context.Context, arg dbsqlc.BindHistoryTurnAssistantByRequestParams) (dbstore.HistoryTurn, error)

func (*Queries) BindLatestHistoryTurnAssistant

func (q *Queries) BindLatestHistoryTurnAssistant(ctx context.Context, arg dbsqlc.BindLatestHistoryTurnAssistantParams) (dbstore.HistoryTurn, error)

func (*Queries) CreateHistoryTurn

func (q *Queries) CreateHistoryTurn(ctx context.Context, arg dbsqlc.CreateHistoryTurnParams) (dbstore.HistoryTurn, error)

func (*Queries) CreateHistoryTurnWithID

func (q *Queries) CreateHistoryTurnWithID(ctx context.Context, arg dbsqlc.CreateHistoryTurnWithIDParams) (dbstore.HistoryTurn, error)

func (*Queries) CreateHistoryTurnWithIDAtPosition

func (q *Queries) CreateHistoryTurnWithIDAtPosition(ctx context.Context, arg dbsqlc.CreateHistoryTurnWithIDAtPositionParams) (dbstore.HistoryTurn, error)

func (*Queries) GetHistoryTurnByID

func (q *Queries) GetHistoryTurnByID(ctx context.Context, arg dbsqlc.GetHistoryTurnByIDParams) (dbstore.HistoryTurn, error)

func (*Queries) GetLatestVisibleHistoryTurnBySession

func (q *Queries) GetLatestVisibleHistoryTurnBySession(ctx context.Context, sessionID pgtype.UUID) (dbstore.HistoryTurn, error)

func (*Queries) GetVisibleHistoryTurnByMessage

func (q *Queries) GetVisibleHistoryTurnByMessage(ctx context.Context, arg dbsqlc.GetVisibleHistoryTurnByMessageParams) (dbstore.HistoryTurn, error)

func (*Queries) InTx

func (q *Queries) InTx(ctx context.Context, fn func(dbstore.Queries) error) error

func (*Queries) ListHistoryTurnsByBot

func (q *Queries) ListHistoryTurnsByBot(ctx context.Context, botID pgtype.UUID) ([]dbstore.HistoryTurn, error)

func (*Queries) SupersedeHistoryTurn

func (q *Queries) SupersedeHistoryTurn(ctx context.Context, arg dbsqlc.SupersedeHistoryTurnParams) (dbstore.HistoryTurn, error)

func (*Queries) SupportsAtomicDirectHistoryTurnWrites

func (*Queries) SupportsAtomicDirectHistoryTurnWrites() bool

func (*Queries) SupportsTransactions

func (q *Queries) SupportsTransactions() bool

SupportsTransactions reports whether InTx opens a real PostgreSQL transaction. Wrappers without a pool or pinned connection retain the historical direct-execution fallback for tests and legacy callers.

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) dbstore.Queries

type Store

type Store struct {
	*dbsqlc.Queries
	// contains filtered or unexported fields
}

func New

func New(pool *pgxpool.Pool) (*Store, error)

func NewWithPool

func NewWithPool(pool *pgxpool.Pool, queries *dbsqlc.Queries) *Store

func NewWithQueries

func NewWithQueries(queries *dbsqlc.Queries) *Store

func (*Store) ActivateUserRuntime

func (s *Store) ActivateUserRuntime(ctx context.Context, runtimeID, apiToken string) (dbstore.UserRuntimeRecord, error)

func (*Store) ActiveWorkdirs added in v0.20.0

func (s *Store) ActiveWorkdirs(ctx context.Context, botID string) ([]dbstore.BotWorkdirRecord, error)

func (*Store) ArchiveWorkdir

func (s *Store) ArchiveWorkdir(ctx context.Context, botID, workdirID string) error

func (*Store) BackfillUserRuntimeName

func (s *Store) BackfillUserRuntimeName(ctx context.Context, runtimeID, userID, name, defaultName string) (bool, error)

func (*Store) CountAccounts

func (s *Store) CountAccounts(ctx context.Context) (int64, error)

func (*Store) CreateAccount

func (s *Store) CreateAccount(ctx context.Context, input dbstore.CreateAccountInput) (dbstore.AccountRecord, error)

func (*Store) CreateOrUpdateMount

func (s *Store) CreateOrUpdateMount(ctx context.Context, botID, runtimeID string) (dbstore.BotRemoteRuntimeBindingRecord, error)

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, input dbstore.CreateUserInput) (dbstore.AccountRecord, error)

func (*Store) CreateUserRuntime

func (s *Store) CreateUserRuntime(ctx context.Context, input dbstore.CreateUserRuntimeInput) (dbstore.UserRuntimeRecord, error)

func (*Store) CreateWorkdir

func (*Store) DeleteMount

func (s *Store) DeleteMount(ctx context.Context, botID, targetID string) error

func (*Store) ExpirePendingUserRuntimes

func (s *Store) ExpirePendingUserRuntimes(ctx context.Context, userID string) error

func (*Store) GetByIdentity

func (s *Store) GetByIdentity(ctx context.Context, identity string) (dbstore.AccountRecord, error)

func (*Store) GetByUserID

func (s *Store) GetByUserID(ctx context.Context, userID string) (dbstore.AccountRecord, error)

func (*Store) GetMount

func (s *Store) GetMount(ctx context.Context, botID, targetID string) (dbstore.BotRemoteRuntimeBindingRecord, error)

func (*Store) GetPrimaryMount

func (s *Store) GetPrimaryMount(ctx context.Context, botID string) (dbstore.BotRemoteRuntimeBindingRecord, error)

func (*Store) GetUserRuntimeByAPIToken

func (s *Store) GetUserRuntimeByAPIToken(ctx context.Context, apiToken string) (dbstore.UserRuntimeRecord, error)

func (*Store) GetWorkdir

func (s *Store) GetWorkdir(ctx context.Context, botID, workdirID string) (dbstore.BotWorkdirRecord, error)

func (*Store) IsValidTitleModel

func (s *Store) IsValidTitleModel(ctx context.Context, modelID string) (bool, error)

func (*Store) List

func (s *Store) List(ctx context.Context) ([]dbstore.AccountRecord, error)

func (*Store) ListGrantsByRuntimeOwner

func (s *Store) ListGrantsByRuntimeOwner(ctx context.Context, ownerUserID string) ([]dbstore.BotRemoteRuntimeBindingRecord, error)

func (*Store) ListMounts

func (s *Store) ListMounts(ctx context.Context, botID string) ([]dbstore.BotRemoteRuntimeBindingRecord, error)

func (*Store) ListUserRuntimes

func (s *Store) ListUserRuntimes(ctx context.Context, userID string) ([]dbstore.UserRuntimeRecord, error)

func (*Store) ListWorkdirs

func (s *Store) ListWorkdirs(ctx context.Context, botID string, includeArchived bool) ([]dbstore.BotWorkdirRecord, error)

func (*Store) Pool

func (s *Store) Pool() *pgxpool.Pool

func (*Store) RemoveMember

func (s *Store) RemoveMember(ctx context.Context, userID string) error

func (*Store) RenameWorkdir

func (s *Store) RenameWorkdir(ctx context.Context, botID, workdirID, name string) (dbstore.BotWorkdirRecord, error)

func (*Store) RevokeUserRuntime

func (s *Store) RevokeUserRuntime(ctx context.Context, runtimeID, userID string) error

func (*Store) SQLC

func (s *Store) SQLC() *dbsqlc.Queries

func (*Store) Search

func (s *Store) Search(ctx context.Context, query string, limit int32) ([]dbstore.AccountRecord, error)

func (*Store) SetPrimary

func (s *Store) SetPrimary(ctx context.Context, botID, targetID string) error

func (*Store) UpdateAdmin

func (*Store) UpdateLastLogin

func (s *Store) UpdateLastLogin(ctx context.Context, accountID string) error

func (*Store) UpdatePassword

func (s *Store) UpdatePassword(ctx context.Context, input dbstore.UpdateAccountPasswordInput) error

func (*Store) UpdateProfile

func (*Store) UpdateToolApproval

func (s *Store) UpdateToolApproval(ctx context.Context, botID, targetID string, config dbstore.JSON) error

func (*Store) WithWorkdirMutation added in v0.20.0

func (s *Store) WithWorkdirMutation(ctx context.Context, botID string, fn func([]dbstore.BotWorkdirRecord) error) error

Jump to

Keyboard shortcuts

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