storedb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package storedb is the sqlc-generated query layer over the deploy control schema.

It is generated from services/deploy/store/migrations and services/deploy/store/queries.sql by services/deploy/store/generate.sh and must never be edited by hand. It is internal on purpose: every type here mirrors the relational schema, so it changes whenever a migration does and carries no compatibility promise. Reach durable control-plane state through services/deploy/store instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendReceiptParams

type AppendReceiptParams struct {
	EntityType    string             `json:"entity_type"`
	EntityID      string             `json:"entity_id"`
	Kind          string             `json:"kind"`
	Summary       string             `json:"summary"`
	PayloadSha256 pgtype.Text        `json:"payload_sha256"`
	OccurredAt    pgtype.Timestamptz `json:"occurred_at"`
}

type CreateApprovalParams

type CreateApprovalParams struct {
	ApprovalID    string             `json:"approval_id"`
	RunID         pgtype.Text        `json:"run_id"`
	ToolCallID    pgtype.Text        `json:"tool_call_id"`
	RequestKind   string             `json:"request_kind"`
	Title         string             `json:"title"`
	Detail        string             `json:"detail"`
	Risk          string             `json:"risk"`
	PayloadSha256 string             `json:"payload_sha256"`
	RequestedAt   pgtype.Timestamptz `json:"requested_at"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
}

type CreateDeploymentRolloutParams

type CreateDeploymentRolloutParams struct {
	RolloutID     string             `json:"rollout_id"`
	DeploymentID  string             `json:"deployment_id"`
	AppRevisionID string             `json:"app_revision_id"`
	DesiredState  string             `json:"desired_state"`
	RequestedAt   pgtype.Timestamptz `json:"requested_at"`
}

type CreateDeploymentRunParams

type CreateDeploymentRunParams struct {
	RunID         string             `json:"run_id"`
	RolloutID     string             `json:"rollout_id"`
	DeploymentID  string             `json:"deployment_id"`
	AppRevisionID string             `json:"app_revision_id"`
	NodeID        string             `json:"node_id"`
	DesiredState  string             `json:"desired_state"`
	WardenTerm    int64              `json:"warden_term"`
	LeaderID      string             `json:"leader_id"`
	RequestedAt   pgtype.Timestamptz `json:"requested_at"`
}

type CreateRunParams

type CreateRunParams struct {
	RunID     string             `json:"run_id"`
	SessionID string             `json:"session_id"`
	Title     string             `json:"title"`
	Prompt    string             `json:"prompt"`
	Status    string             `json:"status"`
	StartedAt pgtype.Timestamptz `json:"started_at"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeployActivityReceipt

type DeployActivityReceipt struct {
	ReceiptID     int64              `json:"receipt_id"`
	EntityType    string             `json:"entity_type"`
	EntityID      string             `json:"entity_id"`
	Kind          string             `json:"kind"`
	Summary       string             `json:"summary"`
	PayloadSha256 pgtype.Text        `json:"payload_sha256"`
	OccurredAt    pgtype.Timestamptz `json:"occurred_at"`
}

type DeployAppRevision

type DeployAppRevision struct {
	AppRevisionID    string             `json:"app_revision_id"`
	AppName          string             `json:"app_name"`
	SourceRepository string             `json:"source_repository"`
	SourceRevision   string             `json:"source_revision"`
	SourceSha256     string             `json:"source_sha256"`
	ComposeFile      string             `json:"compose_file"`
	ImageDigest      pgtype.Text        `json:"image_digest"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
}

type DeployDeployment

type DeployDeployment struct {
	DeploymentID  string             `json:"deployment_id"`
	AppRevisionID string             `json:"app_revision_id"`
	ProjectName   string             `json:"project_name"`
	WorkspacePath string             `json:"workspace_path"`
	DesiredState  string             `json:"desired_state"`
	PlacementMode string             `json:"placement_mode"`
	ExactNodeID   pgtype.Text        `json:"exact_node_id"`
	Replicas      int32              `json:"replicas"`
	Stateful      bool               `json:"stateful"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type DeployDeploymentLabel

type DeployDeploymentLabel struct {
	DeploymentID string `json:"deployment_id"`
	LabelKey     string `json:"label_key"`
	LabelValue   string `json:"label_value"`
}

type DeployDeploymentRollout

type DeployDeploymentRollout struct {
	RolloutID     string             `json:"rollout_id"`
	DeploymentID  string             `json:"deployment_id"`
	AppRevisionID string             `json:"app_revision_id"`
	DesiredState  string             `json:"desired_state"`
	RequestedAt   pgtype.Timestamptz `json:"requested_at"`
}

type DeployDeploymentRun

type DeployDeploymentRun struct {
	RunID         string             `json:"run_id"`
	DeploymentID  string             `json:"deployment_id"`
	AppRevisionID string             `json:"app_revision_id"`
	NodeID        string             `json:"node_id"`
	WardenTerm    int64              `json:"warden_term"`
	LeaderID      string             `json:"leader_id"`
	Status        string             `json:"status"`
	DryRun        pgtype.Bool        `json:"dry_run"`
	ErrorMessage  pgtype.Text        `json:"error_message"`
	RequestedAt   pgtype.Timestamptz `json:"requested_at"`
	FinishedAt    pgtype.Timestamptz `json:"finished_at"`
	RolloutID     string             `json:"rollout_id"`
	DesiredState  string             `json:"desired_state"`
}

type DeployNode

type DeployNode struct {
	NodeID     string             `json:"node_id"`
	Address    string             `json:"address"`
	Role       string             `json:"role"`
	Status     string             `json:"status"`
	WardenTerm int64              `json:"warden_term"`
	LastSeenAt pgtype.Timestamptz `json:"last_seen_at"`
	ObservedAt pgtype.Timestamptz `json:"observed_at"`
}

type DeployNodeLabel

type DeployNodeLabel struct {
	NodeID     string `json:"node_id"`
	LabelKey   string `json:"label_key"`
	LabelValue string `json:"label_value"`
}

type DeployOperatorApproval

type DeployOperatorApproval struct {
	ApprovalID    string             `json:"approval_id"`
	RunID         pgtype.Text        `json:"run_id"`
	ToolCallID    pgtype.Text        `json:"tool_call_id"`
	RequestKind   string             `json:"request_kind"`
	Title         string             `json:"title"`
	Detail        string             `json:"detail"`
	Risk          string             `json:"risk"`
	PayloadSha256 string             `json:"payload_sha256"`
	Status        string             `json:"status"`
	RequestedAt   pgtype.Timestamptz `json:"requested_at"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
	ResolvedAt    pgtype.Timestamptz `json:"resolved_at"`
	ResolvedBy    pgtype.Text        `json:"resolved_by"`
}

type DeployOperatorRun

type DeployOperatorRun struct {
	RunID      string             `json:"run_id"`
	SessionID  string             `json:"session_id"`
	Title      string             `json:"title"`
	Prompt     string             `json:"prompt"`
	Status     string             `json:"status"`
	StartedAt  pgtype.Timestamptz `json:"started_at"`
	FinishedAt pgtype.Timestamptz `json:"finished_at"`
}

type DeployPossiblyActiveDeploymentNode

type DeployPossiblyActiveDeploymentNode struct {
	DeploymentID string `json:"deployment_id"`
	NodeID       string `json:"node_id"`
}

type DeploySchemaMigration

type DeploySchemaMigration struct {
	Version   int32              `json:"version"`
	Name      string             `json:"name"`
	AppliedAt pgtype.Timestamptz `json:"applied_at"`
}

type ExpirePendingApprovalsOnRestartRow

type ExpirePendingApprovalsOnRestartRow struct {
	ApprovalID    string `json:"approval_id"`
	PayloadSha256 string `json:"payload_sha256"`
}

type FinishDeploymentRunParams

type FinishDeploymentRunParams struct {
	Status       string             `json:"status"`
	DryRun       pgtype.Bool        `json:"dry_run"`
	ErrorMessage pgtype.Text        `json:"error_message"`
	FinishedAt   pgtype.Timestamptz `json:"finished_at"`
	RunID        string             `json:"run_id"`
}

type GetDeploymentForReconcileRow

type GetDeploymentForReconcileRow struct {
	DeploymentID      string             `json:"deployment_id"`
	AppRevisionID     string             `json:"app_revision_id"`
	ProjectName       string             `json:"project_name"`
	WorkspacePath     string             `json:"workspace_path"`
	DesiredState      string             `json:"desired_state"`
	PlacementMode     string             `json:"placement_mode"`
	ExactNodeID       pgtype.Text        `json:"exact_node_id"`
	Replicas          int32              `json:"replicas"`
	Stateful          bool               `json:"stateful"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	AppName           string             `json:"app_name"`
	SourceRepository  string             `json:"source_repository"`
	SourceRevision    string             `json:"source_revision"`
	SourceSha256      string             `json:"source_sha256"`
	ComposeFile       string             `json:"compose_file"`
	ImageDigest       pgtype.Text        `json:"image_digest"`
	RevisionCreatedAt pgtype.Timestamptz `json:"revision_created_at"`
}

type ListDeploymentLabelsRow

type ListDeploymentLabelsRow struct {
	LabelKey   string `json:"label_key"`
	LabelValue string `json:"label_value"`
}

type ListDeploymentRolloutRowsRow

type ListDeploymentRolloutRowsRow struct {
	DeploymentID          string             `json:"deployment_id"`
	AppRevisionID         string             `json:"app_revision_id"`
	ProjectName           string             `json:"project_name"`
	WorkspacePath         string             `json:"workspace_path"`
	DesiredState          string             `json:"desired_state"`
	PlacementMode         string             `json:"placement_mode"`
	ExactNodeID           pgtype.Text        `json:"exact_node_id"`
	Replicas              int32              `json:"replicas"`
	Stateful              bool               `json:"stateful"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
	AppName               string             `json:"app_name"`
	SourceRevision        string             `json:"source_revision"`
	SourceSha256          string             `json:"source_sha256"`
	ComposeFile           string             `json:"compose_file"`
	ImageDigest           pgtype.Text        `json:"image_digest"`
	LatestRolloutID       string             `json:"latest_rollout_id"`
	LatestRunID           string             `json:"latest_run_id"`
	LatestNodeID          string             `json:"latest_node_id"`
	LatestDesiredState    string             `json:"latest_desired_state"`
	LatestStatus          string             `json:"latest_status"`
	LatestDryRun          bool               `json:"latest_dry_run"`
	LatestFinishedAt      pgtype.Timestamptz `json:"latest_finished_at"`
	PossiblyActiveNodeIds []string           `json:"possibly_active_node_ids"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AcquireMigrationLock

func (q *Queries) AcquireMigrationLock(ctx context.Context) error

Held until the enclosing migration transaction ends, including when its connection is lost.

func (*Queries) AppendReceipt

func (q *Queries) AppendReceipt(ctx context.Context, arg AppendReceiptParams) (int64, error)

func (*Queries) CreateApproval

func (q *Queries) CreateApproval(ctx context.Context, arg CreateApprovalParams) error

func (*Queries) CreateDeploymentRollout

func (q *Queries) CreateDeploymentRollout(ctx context.Context, arg CreateDeploymentRolloutParams) error

func (*Queries) CreateDeploymentRun

func (q *Queries) CreateDeploymentRun(ctx context.Context, arg CreateDeploymentRunParams) error

func (*Queries) CreateRun

func (q *Queries) CreateRun(ctx context.Context, arg CreateRunParams) error

func (*Queries) DeleteDeploymentLabels

func (q *Queries) DeleteDeploymentLabels(ctx context.Context, deploymentID string) error

func (*Queries) DeleteNodeLabels

func (q *Queries) DeleteNodeLabels(ctx context.Context, nodeID string) error

func (*Queries) ExpireApprovals

func (q *Queries) ExpireApprovals(ctx context.Context, expiredAt pgtype.Timestamptz) (int64, error)

func (*Queries) ExpirePendingApprovalsOnRestart

func (q *Queries) ExpirePendingApprovalsOnRestart(ctx context.Context, interruptedAt pgtype.Timestamptz) ([]ExpirePendingApprovalsOnRestartRow, error)

func (*Queries) FailInterruptedDeploymentRuns

func (q *Queries) FailInterruptedDeploymentRuns(ctx context.Context, interruptedAt pgtype.Timestamptz) ([]string, error)

func (*Queries) FailInterruptedOperatorRuns

func (q *Queries) FailInterruptedOperatorRuns(ctx context.Context, interruptedAt pgtype.Timestamptz) ([]string, error)

func (*Queries) FinishDeploymentRun

func (q *Queries) FinishDeploymentRun(ctx context.Context, arg FinishDeploymentRunParams) (int64, error)

func (*Queries) GetApproval

func (q *Queries) GetApproval(ctx context.Context, approvalID string) (DeployOperatorApproval, error)

func (*Queries) GetDeploymentForReconcile

func (q *Queries) GetDeploymentForReconcile(ctx context.Context, deploymentID string) (GetDeploymentForReconcileRow, error)

func (*Queries) GetRun

func (q *Queries) GetRun(ctx context.Context, runID string) (DeployOperatorRun, error)

func (*Queries) ListAppliedMigrationVersions

func (q *Queries) ListAppliedMigrationVersions(ctx context.Context) ([]int32, error)

func (*Queries) ListDeploymentLabels

func (q *Queries) ListDeploymentLabels(ctx context.Context, deploymentID string) ([]ListDeploymentLabelsRow, error)

func (*Queries) ListDeploymentRolloutRows

func (q *Queries) ListDeploymentRolloutRows(ctx context.Context) ([]ListDeploymentRolloutRowsRow, error)

func (*Queries) ListNodeLabels

func (q *Queries) ListNodeLabels(ctx context.Context, nodeID string) ([]DeployNodeLabel, error)

func (*Queries) ListNodes

func (q *Queries) ListNodes(ctx context.Context) ([]DeployNode, error)

func (*Queries) ListPendingApprovals

func (q *Queries) ListPendingApprovals(ctx context.Context, nowAt pgtype.Timestamptz) ([]DeployOperatorApproval, error)

func (*Queries) ListPossiblyActiveDeploymentNodes

func (q *Queries) ListPossiblyActiveDeploymentNodes(ctx context.Context, deploymentID string) ([]string, error)

func (*Queries) ListRecentReceipts

func (q *Queries) ListRecentReceipts(ctx context.Context, rowLimit int32) ([]DeployActivityReceipt, error)

func (*Queries) ListRecentRuns

func (q *Queries) ListRecentRuns(ctx context.Context, rowLimit int32) ([]DeployOperatorRun, error)

func (*Queries) RecordMigration

func (q *Queries) RecordMigration(ctx context.Context, arg RecordMigrationParams) error

func (*Queries) ResolveApproval

func (q *Queries) ResolveApproval(ctx context.Context, arg ResolveApprovalParams) (int64, error)

func (*Queries) UpdateRunStatus

func (q *Queries) UpdateRunStatus(ctx context.Context, arg UpdateRunStatusParams) (int64, error)

func (*Queries) UpsertAppRevision

func (q *Queries) UpsertAppRevision(ctx context.Context, arg UpsertAppRevisionParams) error

func (*Queries) UpsertDeployment

func (q *Queries) UpsertDeployment(ctx context.Context, arg UpsertDeploymentParams) error

func (*Queries) UpsertDeploymentLabel

func (q *Queries) UpsertDeploymentLabel(ctx context.Context, arg UpsertDeploymentLabelParams) error

func (*Queries) UpsertNode

func (q *Queries) UpsertNode(ctx context.Context, arg UpsertNodeParams) error

func (*Queries) UpsertNodeLabel

func (q *Queries) UpsertNodeLabel(ctx context.Context, arg UpsertNodeLabelParams) error

func (*Queries) WithTx

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

type RecordMigrationParams

type RecordMigrationParams struct {
	Version   int32              `json:"version"`
	Name      string             `json:"name"`
	AppliedAt pgtype.Timestamptz `json:"applied_at"`
}

type ResolveApprovalParams

type ResolveApprovalParams struct {
	Status     string             `json:"status"`
	ResolvedAt pgtype.Timestamptz `json:"resolved_at"`
	ResolvedBy pgtype.Text        `json:"resolved_by"`
	ApprovalID string             `json:"approval_id"`
}

type UpdateRunStatusParams

type UpdateRunStatusParams struct {
	Status     string             `json:"status"`
	FinishedAt pgtype.Timestamptz `json:"finished_at"`
	RunID      string             `json:"run_id"`
}

type UpsertAppRevisionParams

type UpsertAppRevisionParams struct {
	AppRevisionID    string             `json:"app_revision_id"`
	AppName          string             `json:"app_name"`
	SourceRepository string             `json:"source_repository"`
	SourceRevision   string             `json:"source_revision"`
	SourceSha256     string             `json:"source_sha256"`
	ComposeFile      string             `json:"compose_file"`
	ImageDigest      pgtype.Text        `json:"image_digest"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
}

type UpsertDeploymentLabelParams

type UpsertDeploymentLabelParams struct {
	DeploymentID string `json:"deployment_id"`
	LabelKey     string `json:"label_key"`
	LabelValue   string `json:"label_value"`
}

type UpsertDeploymentParams

type UpsertDeploymentParams struct {
	DeploymentID  string             `json:"deployment_id"`
	AppRevisionID string             `json:"app_revision_id"`
	ProjectName   string             `json:"project_name"`
	WorkspacePath string             `json:"workspace_path"`
	DesiredState  string             `json:"desired_state"`
	PlacementMode string             `json:"placement_mode"`
	ExactNodeID   pgtype.Text        `json:"exact_node_id"`
	Replicas      int32              `json:"replicas"`
	Stateful      bool               `json:"stateful"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type UpsertNodeLabelParams

type UpsertNodeLabelParams struct {
	NodeID     string `json:"node_id"`
	LabelKey   string `json:"label_key"`
	LabelValue string `json:"label_value"`
}

type UpsertNodeParams

type UpsertNodeParams struct {
	NodeID     string             `json:"node_id"`
	Address    string             `json:"address"`
	Role       string             `json:"role"`
	Status     string             `json:"status"`
	WardenTerm int64              `json:"warden_term"`
	LastSeenAt pgtype.Timestamptz `json:"last_seen_at"`
	ObservedAt pgtype.Timestamptz `json:"observed_at"`
}

Jump to

Keyboard shortcuts

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