store

package
v0.0.0-...-acf2466 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptInvitationByIDRow

type AcceptInvitationByIDRow struct {
	TeamID       int64
	Role         TeamRole
	CustomRoleID *int64
}

type AcceptInvitationRow

type AcceptInvitationRow struct {
	TeamID       int64
	Email        string
	Role         TeamRole
	CustomRoleID *int64
}

type ActorKind

type ActorKind string
const (
	ActorKindUser   ActorKind = "user"
	ActorKindToken  ActorKind = "token"
	ActorKindSystem ActorKind = "system"
)

func (*ActorKind) Scan

func (e *ActorKind) Scan(src interface{}) error

type AddTeamMemberParams

type AddTeamMemberParams struct {
	TeamID       int64
	UserID       int64
	Role         TeamRole
	CustomRoleID *int64
}

type AdoptionScan

type AdoptionScan struct {
	ID          int64
	Uuid        pgtype.UUID
	TeamID      int64
	ServerID    int64
	Status      AdoptionScanStatus
	Error       *string
	Candidates  []byte
	CreatedBy   *int64
	CreatedAt   pgtype.Timestamptz
	CompletedAt pgtype.Timestamptz
}

type AdoptionScanStatus

type AdoptionScanStatus string
const (
	AdoptionScanStatusPending   AdoptionScanStatus = "pending"
	AdoptionScanStatusRunning   AdoptionScanStatus = "running"
	AdoptionScanStatusCompleted AdoptionScanStatus = "completed"
	AdoptionScanStatusFailed    AdoptionScanStatus = "failed"
)

func (*AdoptionScanStatus) Scan

func (e *AdoptionScanStatus) Scan(src interface{}) error

type AgentToken

type AgentToken struct {
	ID         int64
	Uuid       pgtype.UUID
	ServerID   int64
	TokenHash  string
	TokenEnc   []byte
	CreatedAt  pgtype.Timestamptz
	RotatedAt  pgtype.Timestamptz
	LastSeenAt pgtype.Timestamptz
}

type ApiToken

type ApiToken struct {
	ID          int64
	Uuid        pgtype.UUID
	TeamID      int64
	CreatedBy   *int64
	Name        string
	TokenPrefix string
	TokenHash   string
	Permissions []string
	IpAllowlist []netip.Prefix
	ExpiresAt   pgtype.Timestamptz
	LastUsedAt  pgtype.Timestamptz
	RevokedAt   pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

type Application

type Application struct {
	ID                             int64
	GitSourceID                    *int64
	RepositoryID                   *int64
	GitRepositoryUrl               *string
	GitBranch                      *string
	BaseDirectory                  string
	EnableSubmodules               bool
	EnableLfs                      bool
	EnableShallowClone             bool
	AutoDeployEnabled              bool
	WatchPaths                     *string
	PreviewsEnabled                bool
	PreviewUrlTemplate             string
	PreviewPublicPrsEnabled        bool
	PreviewForkApprovalEnabled     bool
	PreviewMaxConcurrent           *int32
	PreviewTtlMinutes              *int32
	PreviewProtection              PreviewProtection
	PreviewRequireLabel            *string
	PreviewCommentCommandsEnabled  bool
	PreviewExcludeDrafts           bool
	PreviewCancelObsoleteBuilds    bool
	RollbackOnDegradedHealth       bool
	BakeTimeSeconds                *int32
	CreatedAt                      pgtype.Timestamptz
	UpdatedAt                      pgtype.Timestamptz
	PreviewDeployOnOpen            bool
	PreviewUrlTemplates            []byte
	ScaleToZero                    bool
	ScaleToZeroAfterMinutes        int32
	PreviewScaleToZero             bool
	PreviewScaleToZeroAfterMinutes int32
	ScaleSleptAt                   pgtype.Timestamptz
	AccessProtection               PreviewProtection
	AccessBasicAuthEnc             []byte
	AccessPublicRoutes             []byte
	LastActivityAt                 pgtype.Timestamptz
}

type ApproveCliAuthCodeParams

type ApproveCliAuthCodeParams struct {
	RequestIDHash string
	UserID        *int64
	TeamID        *int64
	Permissions   []string
}

type ApprovePreviewForkParams

type ApprovePreviewForkParams struct {
	ID             int64
	ForkApprovedBy *int64
}

type ArtifactKind

type ArtifactKind string
const (
	ArtifactKindLocalImage    ArtifactKind = "local_image"
	ArtifactKindRegistryImage ArtifactKind = "registry_image"
)

func (*ArtifactKind) Scan

func (e *ArtifactKind) Scan(src interface{}) error

type AssignDeploymentBuildServerUnlessCleanupRunningParams

type AssignDeploymentBuildServerUnlessCleanupRunningParams struct {
	DeploymentID  int64
	BuildServerID int64
}

type AuditEvent

type AuditEvent struct {
	ID            int64
	Uuid          pgtype.UUID
	OccurredAt    pgtype.Timestamptz
	TeamID        *int64
	ActorKind     ActorKind
	ActorUuid     pgtype.UUID
	ActorDisplay  *string
	Action        string
	TargetKind    *string
	TargetUuid    pgtype.UUID
	Result        AuditResult
	Ip            *netip.Addr
	UserAgent     *string
	RequestID     pgtype.UUID
	CorrelationID pgtype.UUID
	DiffRedacted  []byte
	CreatedAt     pgtype.Timestamptz
	TargetName    *string
}

type AuditResult

type AuditResult string
const (
	AuditResultSuccess AuditResult = "success"
	AuditResultFailure AuditResult = "failure"
	AuditResultDenied  AuditResult = "denied"
)

func (*AuditResult) Scan

func (e *AuditResult) Scan(src interface{}) error

type BackupExecution

type BackupExecution struct {
	ID             int64
	Uuid           pgtype.UUID
	BackupPlanID   int64
	JobID          *int64
	Status         BackupExecutionStatus
	Filename       *string
	SizeBytes      *int64
	ChecksumSha256 *string
	EngineVersion  *string
	UploadedToS3   bool
	S3UploadError  *string
	LocalDeletedAt pgtype.Timestamptz
	ErrorMessage   *string
	StartedAt      pgtype.Timestamptz
	FinishedAt     pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
	S3Key          *string
	S3DeletedAt    pgtype.Timestamptz
	TableCount     *int32
}

type BackupExecutionStatus

type BackupExecutionStatus string
const (
	BackupExecutionStatusRunning   BackupExecutionStatus = "running"
	BackupExecutionStatusSucceeded BackupExecutionStatus = "succeeded"
	BackupExecutionStatusPartial   BackupExecutionStatus = "partial"
	BackupExecutionStatusFailed    BackupExecutionStatus = "failed"
)

func (*BackupExecutionStatus) Scan

func (e *BackupExecutionStatus) Scan(src interface{}) error

type BuildConfig

type BuildConfig struct {
	ID                       int64
	ApplicationID            int64
	BuildPack                BuildPack
	InstallCommand           *string
	BuildCommand             *string
	StartCommand             *string
	PublishDirectory         *string
	IsSpa                    bool
	CustomNginxConfig        *string
	DockerfilePath           *string
	DockerfileContent        *string
	AutoInjectBuildArgs      bool
	InjectSourceCommit       bool
	ComposeFilePath          *string
	RawCompose               bool
	ImageName                *string
	ImageTag                 *string
	RegistryCredentialID     *int64
	PushEnabled              bool
	PushImageName            *string
	PushImageTag             *string
	PushTagWithCommitSha     bool
	PushRegistryCredentialID *int64
	UseBuildServer           bool
	UseBuildSecrets          bool
	CreatedAt                pgtype.Timestamptz
	UpdatedAt                pgtype.Timestamptz
}

type BuildPack

type BuildPack string
const (
	BuildPackNixpacks   BuildPack = "nixpacks"
	BuildPackRailpack   BuildPack = "railpack"
	BuildPackStatic     BuildPack = "static"
	BuildPackDockerfile BuildPack = "dockerfile"
	BuildPackCompose    BuildPack = "compose"
	BuildPackImage      BuildPack = "image"
)

func (*BuildPack) Scan

func (e *BuildPack) Scan(src interface{}) error

type Certificate

type Certificate struct {
	ID                     int64
	Uuid                   pgtype.UUID
	ServerID               int64
	Kind                   CertificateKind
	MainDomain             string
	Sans                   []string
	Issuer                 *string
	NotBefore              pgtype.Timestamptz
	NotAfter               pgtype.Timestamptz
	Status                 CertificateStatus
	LastError              *string
	DnsProvider            *string
	DnsCredentialID        *int64
	CertPath               *string
	KeyPath                *string
	ObservedAt             pgtype.Timestamptz
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	ExpiryAlertedThreshold *int32
	ExpiryAlertedAt        pgtype.Timestamptz
}

type CertificateKind

type CertificateKind string
const (
	CertificateKindAcmeHttp01 CertificateKind = "acme_http01"
	CertificateKindAcmeDns01  CertificateKind = "acme_dns01"
	CertificateKindCustom     CertificateKind = "custom"
	CertificateKindSelfSigned CertificateKind = "self_signed"
)

func (*CertificateKind) Scan

func (e *CertificateKind) Scan(src interface{}) error

type CertificateStatus

type CertificateStatus string
const (
	CertificateStatusPending  CertificateStatus = "pending"
	CertificateStatusIssued   CertificateStatus = "issued"
	CertificateStatusRenewing CertificateStatus = "renewing"
	CertificateStatusFailed   CertificateStatus = "failed"
	CertificateStatusExpired  CertificateStatus = "expired"
	CertificateStatusRevoked  CertificateStatus = "revoked"
)

func (*CertificateStatus) Scan

func (e *CertificateStatus) Scan(src interface{}) error

type ClaimIdempotencyKeyParams

type ClaimIdempotencyKeyParams struct {
	TeamID      int64
	Key         string
	Endpoint    string
	RequestHash string
}

type ClaimIdempotencyKeyRow

type ClaimIdempotencyKeyRow struct {
	ID           int64
	TeamID       int64
	Key          string
	Endpoint     string
	RequestHash  string
	StatusCode   *int32
	ResponseBody []byte
	CompletedAt  pgtype.Timestamptz
	CreatedAt    pgtype.Timestamptz
	IsNew        bool
}

type ClaimPortForwardSessionParams

type ClaimPortForwardSessionParams struct {
	TokenHash     string
	AttachKeyHash []byte
}

type ClaimTerminalSessionParams

type ClaimTerminalSessionParams struct {
	TokenHash     string
	AttachKeyHash []byte
}

type CliAuthorizationCode

type CliAuthorizationCode struct {
	ID            int64
	RequestIDHash string
	Challenge     string
	UserCode      string
	Status        string
	UserID        *int64
	TeamID        *int64
	Permissions   []string
	ClientName    *string
	ClientIp      *netip.Addr
	ExpiresAt     pgtype.Timestamptz
	CreatedAt     pgtype.Timestamptz
}

type CloudCredential

type CloudCredential struct {
	ID        int64
	Uuid      pgtype.UUID
	TeamID    int64
	Name      string
	Provider  string
	ConfigEnc []byte
	CreatedBy *int64
	UpdatedBy *int64
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
	DeletedAt pgtype.Timestamptz
	Version   int32
}

type CompleteAdoptionScanParams

type CompleteAdoptionScanParams struct {
	ID         int64
	Candidates []byte
}

type CompleteGithubAppConversionParams

type CompleteGithubAppConversionParams struct {
	ID               int64
	Name             string
	AppID            *int64
	Slug             *string
	ClientID         *string
	ClientSecretEnc  []byte
	WebhookSecretEnc []byte
	AppPrivateKeyEnc []byte
	HtmlUrl          string
}

type CompleteIdempotencyKeyParams

type CompleteIdempotencyKeyParams struct {
	ID           int64
	StatusCode   *int32
	ResponseBody []byte
}

type ConfirmMfaFactorParams

type ConfirmMfaFactorParams struct {
	UserID             int64
	RecoveryCodeHashes []string
	LastUsedAt         pgtype.Timestamptz
}

type ConsumeMfaRecoveryCodeParams

type ConsumeMfaRecoveryCodeParams struct {
	ID       int64
	CodeHash string
}

type ConsumeOauthLoginStateParams

type ConsumeOauthLoginStateParams struct {
	StateHash string
	Provider  OauthProvider
	Purpose   string
}

type ConsumePasskeyCeremonyParams

type ConsumePasskeyCeremonyParams struct {
	TokenHash string
	Purpose   string
}

type CountResourcesByEnvironmentRow

type CountResourcesByEnvironmentRow struct {
	EnvironmentID int64
	Resources     int64
}

type CountSuppressedSinceParams

type CountSuppressedSinceParams struct {
	RuleID int64
	Since  pgtype.Timestamptz
}

type CreateAdoptedStorageParams

type CreateAdoptedStorageParams struct {
	Uuid         pgtype.UUID
	ResourceID   int64
	Kind         StorageKind
	Name         *string
	HostPath     *string
	MountPath    string
	ExternalName *string
}

type CreateAdoptionScanParams

type CreateAdoptionScanParams struct {
	Uuid      pgtype.UUID
	TeamID    int64
	ServerID  int64
	CreatedBy *int64
}

type CreateAgentTokenParams

type CreateAgentTokenParams struct {
	Uuid      pgtype.UUID
	ServerID  int64
	TokenHash string
	TokenEnc  []byte
}

type CreateApiTokenParams

type CreateApiTokenParams struct {
	TeamID      int64
	Name        string
	TokenPrefix string
	TokenHash   string
	Permissions []string
	IpAllowlist []netip.Prefix
	ExpiresAt   pgtype.Timestamptz
	CreatedBy   *int64
}

type CreateApplicationAccessTokenParams

type CreateApplicationAccessTokenParams struct {
	TokenHash     string
	ApplicationID *int64
	ExpiresAt     pgtype.Timestamptz
	UserID        *int64
}

type CreateApplicationRowParams

type CreateApplicationRowParams struct {
	ID               int64
	GitRepositoryUrl *string
	GitBranch        *string
	BaseDirectory    string
	GitSourceID      *int64
	RepositoryID     *int64
	WatchPaths       *string
}

type CreateBackupExecutionParams

type CreateBackupExecutionParams struct {
	Uuid         pgtype.UUID
	BackupPlanID int64
}

type CreateBackupPlanParams

type CreateBackupPlanParams struct {
	Uuid                   pgtype.UUID
	CronExpression         string
	Timezone               string
	Enabled                bool
	DumpAll                bool
	IncludedDatabases      []string
	TimeoutSeconds         int32
	S3StorageID            *int64
	S3Only                 bool
	SaveLocal              bool
	RetentionLocalMaxCount int32
	RetentionLocalMaxDays  int32
	RetentionS3MaxCount    int32
	RetentionS3MaxDays     int32
	DrillEnabled           bool
	DrillIntervalDays      int32
	DatabaseID             *int64
	ServiceComponentID     *int64
}

type CreateBuildConfigParams

type CreateBuildConfigParams struct {
	ApplicationID            int64
	BuildPack                BuildPack
	ImageName                *string
	ImageTag                 *string
	DockerfileContent        *string
	DockerfilePath           *string
	PublishDirectory         *string
	RegistryCredentialID     *int64
	UseBuildServer           bool
	PushEnabled              bool
	PushRegistryCredentialID *int64
	RawCompose               bool
	ComposeFilePath          *string
}

type CreateCliAuthCodeParams

type CreateCliAuthCodeParams struct {
	RequestIDHash string
	Challenge     string
	UserCode      string
	ExpiresAt     pgtype.Timestamptz
	ClientName    *string
	ClientIp      *netip.Addr
}

type CreateComponentDomainParams

type CreateComponentDomainParams struct {
	Uuid               pgtype.UUID
	ServiceComponentID *int64
	Fqdn               string
	TargetPort         *int32
}

type CreateCustomRoleParams

type CreateCustomRoleParams struct {
	TeamID      int64
	Name        string
	Description *string
	Permissions []string
}

type CreateDNSCredentialParams

type CreateDNSCredentialParams struct {
	Uuid      pgtype.UUID
	TeamID    int64
	Name      string
	Provider  string
	ConfigEnc []byte
	CreatedBy *int64
}

type CreateDatabaseCredentialParams

type CreateDatabaseCredentialParams struct {
	Uuid        pgtype.UUID
	DatabaseID  int64
	Username    string
	PasswordEnc []byte
	DbName      *string
}

type CreateDatabaseRowParams

type CreateDatabaseRowParams struct {
	ID               int64
	Engine           DbEngine
	Image            *string
	ImageTag         *string
	CustomConfig     *string
	InitdbArgs       *string
	ServerID         int64
	IsPublic         bool
	PublicAccessMode *PublicAccessMode
	PublicPort       *int32
	SslEnabled       bool
	SslMode          *string
}

type CreateDeploymentArtifactParams

type CreateDeploymentArtifactParams struct {
	DeploymentID int64
	Kind         ArtifactKind
	ImageName    string
	ImageTag     *string
	ImageDigest  *string
	ServerID     *int64
}

type CreateDeploymentParams

type CreateDeploymentParams struct {
	Uuid           pgtype.UUID
	ResourceID     int64
	Trigger        DeploymentTrigger
	ApiTokenID     *int64
	ForceRebuild   bool
	ImageName      *string
	ImageTag       *string
	ServerID       int64
	ConfigSnapshot []byte
	PreviewID      *int64
	CommitSha      *string
}

type CreateDeploymentStepParams

type CreateDeploymentStepParams struct {
	DeploymentID int64
	Seq          int32
	Name         string
}

type CreateDestinationParams

type CreateDestinationParams struct {
	Uuid      pgtype.UUID
	ServerID  int64
	Name      string
	Network   string
	IsDefault bool
}

type CreateDomainParams

type CreateDomainParams struct {
	Uuid          pgtype.UUID
	ApplicationID *int64
	Fqdn          string
	Path          string
	TargetPort    *int32
	IsGenerated   bool
}

type CreateDraftGithubAppParams

type CreateDraftGithubAppParams struct {
	TeamID            int64
	Name              string
	ApiUrl            string
	HtmlUrl           string
	ManifestStateHash *string
	CreatedBy         *int64
}

type CreateEndpointPortForwardSessionParams

type CreateEndpointPortForwardSessionParams struct {
	TeamID             int64
	ServerID           *int64
	ExternalEndpointID *int64
	TargetName         string
	TargetPort         int32
	TokenHash          string
	TokenExpiresAt     pgtype.Timestamptz
	UserID             *int64
	GrantID            *int64
	ClientIp           *netip.Addr
	AuthorizedUntil    pgtype.Timestamptz
}

type CreateEnvVarParams

type CreateEnvVarParams struct {
	Uuid        pgtype.UUID
	ResourceID  int64
	Key         string
	ValueEnc    []byte
	IsBuildTime bool
	IsLiteral   bool
	IsMultiline bool
	IsLocked    bool
	IsSecret    bool
	IsPreview   bool
	PreviewID   *int64
}

type CreateEnvironmentParams

type CreateEnvironmentParams struct {
	ProjectID   int64
	Name        string
	Slug        string
	Description *string
}

type CreateExternalEndpointGrantParams

type CreateExternalEndpointGrantParams struct {
	EndpointID  int64
	UserID      int64
	Reason      string
	Factor      string
	ExpiresAt   pgtype.Timestamptz
	GrantedBy   *int64
	RenewedFrom *int64
}

type CreateExternalEndpointParams

type CreateExternalEndpointParams struct {
	TeamID          int64
	Name            string
	Host            string
	Port            int32
	ServerID        int64
	Criticality     ExternalEndpointCriticality
	MaxGrantMinutes int32
	Description     *string
	ProjectID       *int64
	EnvironmentID   *int64
	CreatedBy       *int64
}

type CreateGeneratedEnvVarParams

type CreateGeneratedEnvVarParams struct {
	Uuid       pgtype.UUID
	ResourceID int64
	Key        string
	ValueEnc   []byte
	IsSecret   bool
}

type CreateGeneratedPreviewEnvVarParams

type CreateGeneratedPreviewEnvVarParams struct {
	Uuid       pgtype.UUID
	ResourceID int64
	Key        string
	ValueEnc   []byte
}

type CreateGeneratedStorageParams

type CreateGeneratedStorageParams struct {
	Uuid         pgtype.UUID
	ResourceID   int64
	Name         *string
	MountPath    string
	ExternalName *string
}

type CreateGitSourceParams

type CreateGitSourceParams struct {
	TeamID       int64
	Name         string
	Kind         GitSourceKind
	Provider     GitProvider
	PrivateKeyID *int64
	CreatedBy    *int64
}

type CreateGithubAppSourceParams

type CreateGithubAppSourceParams struct {
	TeamID      int64
	Name        string
	ApiUrl      *string
	HtmlUrl     *string
	GithubAppID *int64
	CreatedBy   *int64
}

type CreateIdentityParams

type CreateIdentityParams struct {
	UserID          int64
	Provider        OauthProvider
	ProviderSubject string
	Email           *string
}

type CreateIngressAccessTokenParams

type CreateIngressAccessTokenParams struct {
	TokenHash         string
	IngressEndpointID *int64
	ExpiresAt         pgtype.Timestamptz
}

type CreateIngressDomainParams

type CreateIngressDomainParams struct {
	Uuid              pgtype.UUID
	IngressEndpointID *int64
	Fqdn              string
}

type CreateIngressEndpointParams

type CreateIngressEndpointParams struct {
	TeamID        int64
	Name          string
	Fqdn          string
	ServerID      int64
	Access        IngressAccess
	Description   *string
	BasicAuthHash *string
	CreatedBy     *int64
}

type CreateIngressSessionParams

type CreateIngressSessionParams struct {
	TeamID         int64
	EndpointID     *int64
	TokenHash      string
	TokenExpiresAt pgtype.Timestamptz
	UserID         *int64
	ClientIp       *netip.Addr
}

type CreateInvitationParams

type CreateInvitationParams struct {
	TeamID       int64
	Email        string
	Role         TeamRole
	TokenHash    string
	ExpiresAt    pgtype.Timestamptz
	CustomRoleID *int64
}

type CreateLocalhostServerIfAbsentParams

type CreateLocalhostServerIfAbsentParams struct {
	TeamID       int64
	Host         string
	SshUser      string
	PrivateKeyID int64
}

type CreateMcpAccessTokenParams

type CreateMcpAccessTokenParams struct {
	TokenHash  string
	ClientID   string
	ClientName string
	UserID     int64
	TeamID     int64
	ExpiresAt  pgtype.Timestamptz
}

type CreateMcpOauthCodeParams

type CreateMcpOauthCodeParams struct {
	CodeHash      string
	ClientID      string
	UserID        int64
	TeamID        int64
	RedirectUri   string
	CodeChallenge string
	ExpiresAt     pgtype.Timestamptz
}

type CreateMfaChallengeParams

type CreateMfaChallengeParams struct {
	TokenHash string
	UserID    int64
	ExpiresAt pgtype.Timestamptz
}

type CreateNoBuildDeploymentParams

type CreateNoBuildDeploymentParams struct {
	Uuid           pgtype.UUID
	ResourceID     int64
	Trigger        DeploymentTrigger
	ApiTokenID     *int64
	ImageName      *string
	ImageTag       *string
	ImageDigest    *string
	ServerID       int64
	ConfigSnapshot []byte
	PreviewID      *int64
	CommitSha      *string
}

type CreateNotificationChannelParams

type CreateNotificationChannelParams struct {
	Uuid      pgtype.UUID
	TeamID    int64
	Kind      NotificationChannelKind
	Name      string
	ConfigEnc []byte
	Enabled   bool
}

type CreateNotificationDeliveryParams

type CreateNotificationDeliveryParams struct {
	RuleID        int64
	ChannelID     int64
	OutboxEventID int64
}

type CreateNotificationRuleParams

type CreateNotificationRuleParams struct {
	Uuid                  pgtype.UUID
	ChannelID             int64
	EventType             string
	Enabled               bool
	MinSeverity           NotificationSeverity
	DebounceSeconds       int32
	DigestEnabled         bool
	DigestIntervalMinutes int32
	ProjectID             *int64
	EnvironmentID         *int64
	QuietHoursStart       pgtype.Time
	QuietHoursEnd         pgtype.Time
}

type CreateOauthLoginStateParams

type CreateOauthLoginStateParams struct {
	StateHash    string
	Provider     OauthProvider
	Purpose      string
	UserID       *int64
	PkceVerifier string
	Nonce        string
	ExpiresAt    pgtype.Timestamptz
}

type CreatePasskeyCeremonyParams

type CreatePasskeyCeremonyParams struct {
	TokenHash string
	Purpose   string
	UserID    *int64
	Data      []byte
	ExpiresAt pgtype.Timestamptz
}

type CreatePasskeyCredentialParams

type CreatePasskeyCredentialParams struct {
	UserID       int64
	Name         string
	CredentialID []byte
	Credential   []byte
}

type CreatePortForwardSessionParams

type CreatePortForwardSessionParams struct {
	TeamID          int64
	TargetName      string
	TargetPort      int32
	TokenHash       string
	TokenExpiresAt  pgtype.Timestamptz
	UserID          *int64
	ServerID        *int64
	ResourceID      *int64
	PreviewID       *int64
	TargetComponent *string
	ClientIp        *netip.Addr
}

type CreatePreviewAccessTokenParams

type CreatePreviewAccessTokenParams struct {
	TokenHash string
	PreviewID *int64
	ExpiresAt pgtype.Timestamptz
	UserID    *int64
}

type CreatePrivateKeyParams

type CreatePrivateKeyParams struct {
	Uuid              pgtype.UUID
	TeamID            *int64
	Name              string
	Description       *string
	FingerprintSha256 string
	PublicKey         string
	PrivateKeyEnc     []byte
	IsInstance        bool
}

type CreateProjectParams

type CreateProjectParams struct {
	TeamID      int64
	Name        string
	Slug        string
	Description *string
}

type CreateProxyRevisionParams

type CreateProxyRevisionParams struct {
	ServerID       int64
	Scope          string
	ProxyType      ProxyType
	ChecksumSha256 string
	Content        string
}

type CreateRegistryCredentialParams

type CreateRegistryCredentialParams struct {
	Uuid        pgtype.UUID
	TeamID      int64
	Name        string
	RegistryUrl string
	Username    string
	PasswordEnc []byte
	CreatedBy   *int64
}

type CreateResourceAccessTokenParams

type CreateResourceAccessTokenParams struct {
	TokenHash     string
	ResourceID    *int64
	ExpiresAt     pgtype.Timestamptz
	ApplicationID *int64
	UserID        *int64
}

type CreateResourceParams

type CreateResourceParams struct {
	Uuid          pgtype.UUID
	TeamID        int64
	EnvironmentID int64
	DestinationID int64
	ResourceType  ResourceType
	Name          string
	Description   *string
}

type CreateRestoreDrillParams

type CreateRestoreDrillParams struct {
	PlanID         int64
	ExecutionID    *int64
	TablesExpected *int32
}

type CreateRollbackDeploymentParams

type CreateRollbackDeploymentParams struct {
	Uuid           pgtype.UUID
	ResourceID     int64
	Trigger        DeploymentTrigger
	ApiTokenID     *int64
	ImageName      *string
	ImageTag       *string
	ImageDigest    *string
	ServerID       int64
	ConfigSnapshot []byte
}

type CreateRuntimeConfigParams

type CreateRuntimeConfigParams struct {
	ApplicationID         int64
	PortsExposes          *string
	MemoryLimit           *string
	CpuLimit              pgtype.Numeric
	Noindex               bool
	PreDeploymentCommand  *string
	PostDeploymentCommand *string
}

type CreateS3StorageParams

type CreateS3StorageParams struct {
	Uuid           pgtype.UUID
	TeamID         int64
	Name           string
	Endpoint       string
	Region         *string
	Bucket         string
	PathPrefix     *string
	AccessKeyEnc   []byte
	SecretKeyEnc   []byte
	IsUsable       bool
	LastCheckError *string
	SseAlgorithm   *string
}

type CreateScheduledTaskParams

type CreateScheduledTaskParams struct {
	TeamID          int64
	ResourceID      int64
	Kind            TaskKind
	Name            string
	Command         *string
	Container       *string
	CronExpression  string
	Timezone        string
	Enabled         bool
	OverlapPolicy   TaskOverlapPolicy
	MissedRunPolicy TaskMissedRunPolicy
	TimeoutSeconds  int32
	WorkflowFile    *string
	WorkflowRef     *string
	WorkflowInputs  []byte
	CreatedBy       *int64
}

type CreateScimTokenParams

type CreateScimTokenParams struct {
	TeamID    int64
	Name      string
	TokenHash string
	CreatedBy *int64
}

type CreateServerParams

type CreateServerParams struct {
	TeamID            int64
	Name              string
	Description       *string
	Host              string
	Port              int32
	SshUser           string
	SshTimeoutSeconds int32
	PrivateKeyID      int64
	IsBuildServer     bool
	WildcardDomain    *string
	ProxyType         ProxyType
	ProxyHttpPort     int32
	ProxyHttpsPort    int32
	DnsCredentialID   *int64
}

type CreateServiceRowParams

type CreateServiceRowParams struct {
	ID                         int64
	ComposeContent             string
	ConnectToPredefinedNetwork bool
	Noindex                    bool
	TemplateSlug               *string
	TemplateVersion            *string
	TemplateRepository         *string
}

type CreateSessionParams

type CreateSessionParams struct {
	UserID        int64
	TokenHash     string
	CsrfToken     *string
	CurrentTeamID *int64
	Ip            *netip.Addr
	UserAgent     *string
	ExpiresAt     pgtype.Timestamptz
	MfaPending    bool
}

type CreateSharedVariableParams

type CreateSharedVariableParams struct {
	Uuid          pgtype.UUID
	TeamID        int64
	Scope         SharedVariableScope
	Key           string
	ValueEnc      []byte
	IsSecret      bool
	ProjectID     *int64
	EnvironmentID *int64
	ServerID      *int64
	CreatedBy     *int64
}

type CreateStorageParams

type CreateStorageParams struct {
	Uuid       pgtype.UUID
	ResourceID int64
	Kind       StorageKind
	Name       *string
	HostPath   *string
	MountPath  string
}

type CreateTaskExecutionParams

type CreateTaskExecutionParams struct {
	ScheduledTaskID int64
	Status          TaskExecutionStatus
	SkipReason      *string
}

type CreateTeamParams

type CreateTeamParams struct {
	Name        string
	Description *string
}

type CreateTerminalSessionParams

type CreateTerminalSessionParams struct {
	TeamID          int64
	TargetKind      TerminalTarget
	TargetName      string
	TokenHash       string
	TokenExpiresAt  pgtype.Timestamptz
	UserID          *int64
	ServerID        *int64
	ResourceID      *int64
	TargetComponent *string
	PreviewID       *int64
	ClientIp        *netip.Addr
}

type CreateUptimeCheckParams

type CreateUptimeCheckParams struct {
	Uuid             pgtype.UUID
	TeamID           int64
	Name             string
	Kind             UptimeCheckKind
	Target           string
	IntervalSeconds  int32
	TimeoutSeconds   int32
	FailureThreshold int32
	SuccessThreshold int32
	Enabled          bool
	ResourceID       *int64
}

type CreateUserParams

type CreateUserParams struct {
	Email        string
	Name         string
	PasswordHash *string
	IsRoot       bool
}

type CreateWebhookDeliveryParams

type CreateWebhookDeliveryParams struct {
	Provider          WebhookProvider
	DeliveryID        string
	SignatureValid    bool
	Status            WebhookDeliveryStatus
	WebhookEndpointID *int64
	EventType         *string
	Payload           []byte
	TeamID            *int64
	ApplicationID     *int64
}

type CreateWebhookEndpointParams

type CreateWebhookEndpointParams struct {
	Uuid          pgtype.UUID
	ApplicationID int64
	Provider      WebhookProvider
	SecretEnc     []byte
}

type CustomRole

type CustomRole struct {
	ID          int64
	Uuid        pgtype.UUID
	TeamID      int64
	Name        string
	Description *string
	Permissions []string
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

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 Database

type Database struct {
	ID                     int64
	Engine                 DbEngine
	Image                  *string
	ImageTag               *string
	CustomConfig           *string
	InitdbArgs             *string
	ServerID               int64
	IsPublic               bool
	PublicAccessMode       *PublicAccessMode
	PublicPort             *int32
	TcpProxyTimeoutSeconds int32
	SslEnabled             bool
	SslMode                *string
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
}

type DatabaseBackupPlan

type DatabaseBackupPlan struct {
	ID                     int64
	Uuid                   pgtype.UUID
	DatabaseID             *int64
	ServiceComponentID     *int64
	IsInstanceBackup       bool
	Enabled                bool
	CronExpression         string
	Timezone               string
	DumpAll                bool
	IncludedDatabases      []string
	ExcludedCollections    []string
	TimeoutSeconds         int32
	S3StorageID            *int64
	S3Only                 bool
	SaveLocal              bool
	RetentionLocalMaxCount int32
	RetentionLocalMaxDays  int32
	RetentionS3MaxCount    int32
	RetentionS3MaxDays     int32
	CreatedBy              *int64
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	DeletedAt              pgtype.Timestamptz
	Version                int32
	NextRunAt              pgtype.Timestamptz
	LastRunAt              pgtype.Timestamptz
	DrillEnabled           bool
	DrillIntervalDays      int32
	LastDrillAt            pgtype.Timestamptz
	LastDrillStatus        *RestoreDrillStatus
}

type DatabaseCredential

type DatabaseCredential struct {
	ID          int64
	Uuid        pgtype.UUID
	DatabaseID  int64
	Username    string
	PasswordEnc []byte
	DbName      *string
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

type DbEngine

type DbEngine string
const (
	DbEnginePostgresql DbEngine = "postgresql"
	DbEngineMysql      DbEngine = "mysql"
	DbEngineMariadb    DbEngine = "mariadb"
	DbEngineMongodb    DbEngine = "mongodb"
	DbEngineRedis      DbEngine = "redis"
	DbEngineKeydb      DbEngine = "keydb"
	DbEngineDragonfly  DbEngine = "dragonfly"
	DbEngineClickhouse DbEngine = "clickhouse"
)

func (*DbEngine) Scan

func (e *DbEngine) Scan(src interface{}) error

type DeleteCustomRoleParams

type DeleteCustomRoleParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type DeleteEnvVarsNotInKeysParams

type DeleteEnvVarsNotInKeysParams struct {
	ResourceID int64
	Keys       []string
}

type DeleteExternalEndpointParams

type DeleteExternalEndpointParams struct {
	ID     int64
	TeamID int64
}

type DeleteIdentityForUserParams

type DeleteIdentityForUserParams struct {
	Uuid   pgtype.UUID
	UserID int64
}

type DeleteIngressEndpointParams

type DeleteIngressEndpointParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type DeletePasskeyForUserParams

type DeletePasskeyForUserParams struct {
	Uuid   pgtype.UUID
	UserID int64
}

type DeleteVanishedRepositoriesParams

type DeleteVanishedRepositoriesParams struct {
	GitSourceID int64
	ExternalIds []string
}

type DeleteVanishedServiceComponentsParams

type DeleteVanishedServiceComponentsParams struct {
	ResourceID int64
	Names      []string
}

type Deployment

type Deployment struct {
	ID             int64
	Uuid           pgtype.UUID
	ResourceID     int64
	Status         DeploymentStatus
	Attempt        int32
	RetryOfID      *int64
	SupersededByID *int64
	IsRollback     bool
	Trigger        DeploymentTrigger
	TriggeredBy    *int64
	ApiTokenID     *int64
	GitBranch      *string
	CommitSha      *string
	IsLocalSource  bool
	ContextDigest  *string
	ForceRebuild   bool
	ImageName      *string
	ImageTag       *string
	ImageDigest    *string
	ConfigSnapshot []byte
	ConfigDiff     []byte
	ErrorMessage   *string
	ServerID       int64
	BuildServerID  *int64
	QueuedAt       pgtype.Timestamptz
	StartedAt      pgtype.Timestamptz
	FinishedAt     pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	PreviewID      *int64
	CommitAuthor   *string
	CommitMessage  *string
	SkipBuild      bool
}

type DeploymentArtifact

type DeploymentArtifact struct {
	ID                   int64
	Uuid                 pgtype.UUID
	DeploymentID         int64
	Kind                 ArtifactKind
	ImageName            string
	ImageTag             *string
	ImageDigest          *string
	ServerID             *int64
	RegistryCredentialID *int64
	ProtectedFromCleanup bool
	CreatedAt            pgtype.Timestamptz
}

type DeploymentStatus

type DeploymentStatus string
const (
	DeploymentStatusQueued         DeploymentStatus = "queued"
	DeploymentStatusPreparing      DeploymentStatus = "preparing"
	DeploymentStatusCloning        DeploymentStatus = "cloning"
	DeploymentStatusBuilding       DeploymentStatus = "building"
	DeploymentStatusPushing        DeploymentStatus = "pushing"
	DeploymentStatusStarting       DeploymentStatus = "starting"
	DeploymentStatusHealthchecking DeploymentStatus = "healthchecking"
	DeploymentStatusSwitching      DeploymentStatus = "switching"
	DeploymentStatusFinishing      DeploymentStatus = "finishing"
	DeploymentStatusSucceeded      DeploymentStatus = "succeeded"
	DeploymentStatusFailed         DeploymentStatus = "failed"
	DeploymentStatusCancelled      DeploymentStatus = "cancelled"
	DeploymentStatusRetrying       DeploymentStatus = "retrying"
	DeploymentStatusSuperseded     DeploymentStatus = "superseded"
)

func (*DeploymentStatus) Scan

func (e *DeploymentStatus) Scan(src interface{}) error

type DeploymentStep

type DeploymentStep struct {
	ID           int64
	DeploymentID int64
	Seq          int32
	Name         string
	Status       DeploymentStepStatus
	ExitCode     *int32
	Log          *string
	StartedAt    pgtype.Timestamptz
	FinishedAt   pgtype.Timestamptz
	CreatedAt    pgtype.Timestamptz
}

type DeploymentStepStatus

type DeploymentStepStatus string
const (
	DeploymentStepStatusPending   DeploymentStepStatus = "pending"
	DeploymentStepStatusRunning   DeploymentStepStatus = "running"
	DeploymentStepStatusSucceeded DeploymentStepStatus = "succeeded"
	DeploymentStepStatusFailed    DeploymentStepStatus = "failed"
	DeploymentStepStatusSkipped   DeploymentStepStatus = "skipped"
	DeploymentStepStatusCancelled DeploymentStepStatus = "cancelled"
)

func (*DeploymentStepStatus) Scan

func (e *DeploymentStepStatus) Scan(src interface{}) error

type DeploymentTrigger

type DeploymentTrigger string
const (
	DeploymentTriggerManual      DeploymentTrigger = "manual"
	DeploymentTriggerWebhook     DeploymentTrigger = "webhook"
	DeploymentTriggerApi         DeploymentTrigger = "api"
	DeploymentTriggerPreview     DeploymentTrigger = "preview"
	DeploymentTriggerSchedule    DeploymentTrigger = "schedule"
	DeploymentTriggerConfigApply DeploymentTrigger = "config_apply"
	DeploymentTriggerCliLocal    DeploymentTrigger = "cli_local"
)

func (*DeploymentTrigger) Scan

func (e *DeploymentTrigger) Scan(src interface{}) error

type DequeueJobParams

type DequeueJobParams struct {
	WorkerID     *string
	LeaseSeconds int32
	Queues       []string
}

type Destination

type Destination struct {
	ID        int64
	Uuid      pgtype.UUID
	ServerID  int64
	Name      string
	Network   string
	IsDefault bool
	CreatedBy *int64
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type Domain

type Domain struct {
	ID                 int64
	Uuid               pgtype.UUID
	ApplicationID      *int64
	ServiceComponentID *int64
	Fqdn               string
	Path               string
	TargetPort         *int32
	IsGenerated        bool
	CreatedBy          *int64
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
	IngressEndpointID  *int64
}

type EncryptionRotationApplyParams

type EncryptionRotationApplyParams struct {
	TableName  string
	ColumnName string
	RowID      int64
	Value      []byte
}

type EncryptionRotationCandidatesParams

type EncryptionRotationCandidatesParams struct {
	TableName     string
	ColumnName    string
	ActiveVersion int32
	RowLimit      int32
}

type EndIngressSessionByUUIDParams

type EndIngressSessionByUUIDParams struct {
	Uuid      pgtype.UUID
	TeamID    int64
	EndReason *TerminalEndReason
}

type EndIngressSessionParams

type EndIngressSessionParams struct {
	ID        int64
	EndReason *TerminalEndReason
}

type EndPortForwardSessionParams

type EndPortForwardSessionParams struct {
	ID        int64
	EndReason *TerminalEndReason
	AttachSeq *int64
}

type EndTerminalSessionParams

type EndTerminalSessionParams struct {
	ID        int64
	EndReason *TerminalEndReason
	AttachSeq *int64
}

type EnqueueJobParams

type EnqueueJobParams struct {
	Uuid           pgtype.UUID
	Queue          string
	JobType        string
	Payload        []byte
	Priority       int32
	RunAt          pgtype.Timestamptz
	MaxAttempts    int32
	IdempotencyKey *string
	LockKey        *string
	TeamID         *int64
	ResourceID     *int64
	CorrelationID  pgtype.UUID
	RetryOfID      *int64
	Status         JobStatus
}

type Environment

type Environment struct {
	ID          int64
	Uuid        pgtype.UUID
	ProjectID   int64
	Name        string
	Slug        string
	Description *string
	CreatedBy   *int64
	UpdatedBy   *int64
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	Version     int32
}

type EnvironmentVariable

type EnvironmentVariable struct {
	ID          int64
	Uuid        pgtype.UUID
	ResourceID  int64
	Key         string
	ValueEnc    []byte
	IsSecret    bool
	IsBuildTime bool
	IsLiteral   bool
	IsMultiline bool
	IsLocked    bool
	IsPreview   bool
	IsGenerated bool
	CreatedBy   *int64
	UpdatedBy   *int64
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	PreviewID   *int64
}

type ExtendExternalEndpointGrantParams

type ExtendExternalEndpointGrantParams struct {
	ID        int64
	ExpiresAt pgtype.Timestamptz
	Reason    string
	Factor    string
}

type ExternalEndpoint

type ExternalEndpoint struct {
	ID              int64
	Uuid            pgtype.UUID
	TeamID          int64
	Name            string
	Description     *string
	Host            string
	Port            int32
	ServerID        int64
	ProjectID       *int64
	EnvironmentID   *int64
	Criticality     ExternalEndpointCriticality
	MaxGrantMinutes int32
	CreatedBy       *int64
	UpdatedBy       *int64
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	Version         int32
}

type ExternalEndpointCriticality

type ExternalEndpointCriticality string
const (
	ExternalEndpointCriticalityStandard  ExternalEndpointCriticality = "standard"
	ExternalEndpointCriticalitySensitive ExternalEndpointCriticality = "sensitive"
)

func (*ExternalEndpointCriticality) Scan

func (e *ExternalEndpointCriticality) Scan(src interface{}) error

type ExternalEndpointGrant

type ExternalEndpointGrant struct {
	ID          int64
	Uuid        pgtype.UUID
	EndpointID  int64
	UserID      int64
	Reason      string
	Factor      string
	GrantedBy   *int64
	RenewedFrom *int64
	RequestedAt pgtype.Timestamptz
	ExpiresAt   pgtype.Timestamptz
	RevokedAt   pgtype.Timestamptz
	RevokedBy   *int64
	CreatedAt   pgtype.Timestamptz
}

type FailAdoptionScanParams

type FailAdoptionScanParams struct {
	ID    int64
	Error *string
}

type FailJobParams

type FailJobParams struct {
	ID           int64
	LastError    *string
	ToDeadLetter bool
	NextRunAt    pgtype.Timestamptz
	WorkerID     *string
}

type FinishBackupExecutionParams

type FinishBackupExecutionParams struct {
	ID             int64
	Status         BackupExecutionStatus
	Filename       *string
	SizeBytes      *int64
	ChecksumSha256 *string
	EngineVersion  *string
	UploadedToS3   bool
	S3UploadError  *string
	ErrorMessage   *string
	S3Key          *string
}

type FinishDeploymentStepParams

type FinishDeploymentStepParams struct {
	ID       int64
	Status   DeploymentStepStatus
	ExitCode *int32
	Log      *string
}

type FinishNotificationDeliveryParams

type FinishNotificationDeliveryParams struct {
	ID               int64
	Status           NotificationDeliveryStatus
	LastError        *string
	SuppressedReason *string
}

type FinishRestoreDrillParams

type FinishRestoreDrillParams struct {
	ID             int64
	Status         RestoreDrillStatus
	TablesRestored *int32
	ErrorMessage   *string
}

type FinishTaskExecutionParams

type FinishTaskExecutionParams struct {
	ID              int64
	Status          TaskExecutionStatus
	ExitCode        *int32
	Output          *string
	OutputTruncated bool
}

type FinishWebhookDeliveryParams

type FinishWebhookDeliveryParams struct {
	ID           int64
	Status       WebhookDeliveryStatus
	IgnoreReason *string
}

type GetActiveApiTokensByPrefixRow

type GetActiveApiTokensByPrefixRow struct {
	ID          int64
	Uuid        pgtype.UUID
	TeamID      int64
	CreatedBy   *int64
	Name        string
	TokenPrefix string
	TokenHash   string
	Permissions []string
	IpAllowlist []netip.Prefix
	ExpiresAt   pgtype.Timestamptz
	LastUsedAt  pgtype.Timestamptz
	RevokedAt   pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	TeamUuid    pgtype.UUID
}

type GetAdoptionScanByUUIDForTeamParams

type GetAdoptionScanByUUIDForTeamParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetAdoptionScanByUUIDForTeamRow

type GetAdoptionScanByUUIDForTeamRow struct {
	AdoptionScan AdoptionScan
	ServerUuid   pgtype.UUID
}

type GetApplicationAccessByUUIDRow

type GetApplicationAccessByUUIDRow struct {
	ID               int64
	Uuid             pgtype.UUID
	TeamID           int64
	AccessProtection PreviewProtection
}

type GetApplicationByIDRow

type GetApplicationByIDRow struct {
	Resource      Resource
	Application   Application
	BuildConfig   BuildConfig
	RuntimeConfig RuntimeConfig
}

type GetApplicationByRoutedHostRow

type GetApplicationByRoutedHostRow struct {
	ID               int64
	Uuid             pgtype.UUID
	TeamID           int64
	AccessProtection PreviewProtection
}

type GetApplicationByUUIDParams

type GetApplicationByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetApplicationByUUIDRow

type GetApplicationByUUIDRow struct {
	Resource                   Resource
	Application                Application
	BuildConfig                BuildConfig
	RuntimeConfig              RuntimeConfig
	EnvironmentUuid            pgtype.UUID
	ProjectUuid                pgtype.UUID
	DestinationUuid            pgtype.UUID
	ServerUuid                 pgtype.UUID
	ServerRowID                int64
	PrivateKeyUuid             pgtype.UUID
	RegistryCredentialUuid     pgtype.UUID
	PushRegistryCredentialUuid pgtype.UUID
	GitApiTokenSet             bool
	GitApiUrl                  *string
	GithubAppUuid              pgtype.UUID
}

type GetArtifactByDigestParams

type GetArtifactByDigestParams struct {
	ImageDigest *string
	ResourceID  int64
}

type GetArtifactForDeploymentParams

type GetArtifactForDeploymentParams struct {
	Uuid       pgtype.UUID
	ResourceID int64
}

type GetBackupExecutionByUUIDParams

type GetBackupExecutionByUUIDParams struct {
	Uuid         pgtype.UUID
	BackupPlanID int64
}

type GetBackupPlanByUUIDForComponentParams

type GetBackupPlanByUUIDForComponentParams struct {
	Uuid               pgtype.UUID
	ServiceComponentID *int64
}

type GetBackupPlanByUUIDParams

type GetBackupPlanByUUIDParams struct {
	Uuid       pgtype.UUID
	DatabaseID *int64
}

type GetCertificateByUUIDForTeamParams

type GetCertificateByUUIDForTeamParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetCertificateByUUIDForTeamRow

type GetCertificateByUUIDForTeamRow struct {
	Certificate Certificate
	ServerUuid  pgtype.UUID
}

type GetComponentBackupTargetRow

type GetComponentBackupTargetRow struct {
	ServiceComponent ServiceComponent
	StackUuid        pgtype.UUID
	StackResourceID  int64
	TeamID           int64
	ServerID         int64
}

type GetCustomRoleByUUIDParams

type GetCustomRoleByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetDNSCredentialByUUIDParams

type GetDNSCredentialByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetDatabaseByIDRow

type GetDatabaseByIDRow struct {
	Resource           Resource
	Database           Database
	DatabaseCredential DatabaseCredential
}

type GetDatabaseByUUIDParams

type GetDatabaseByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetDatabaseByUUIDRow

type GetDatabaseByUUIDRow struct {
	Resource           Resource
	Database           Database
	DatabaseCredential DatabaseCredential
	EnvironmentUuid    pgtype.UUID
	ProjectUuid        pgtype.UUID
	ServerUuid         pgtype.UUID
	ServerHost         string
}

type GetDeployKeySourceParams

type GetDeployKeySourceParams struct {
	TeamID       int64
	PrivateKeyID *int64
}

type GetDeploymentByUUIDForTeamParams

type GetDeploymentByUUIDForTeamParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetDeploymentByUUIDForTeamRow

type GetDeploymentByUUIDForTeamRow struct {
	Deployment       Deployment
	ResourceUuid     pgtype.UUID
	PrID             *int32
	GitRepositoryUrl *string
	GitProvider      *GitProvider
}

type GetEnvVarByKeyParams

type GetEnvVarByKeyParams struct {
	ResourceID int64
	Key        string
}

type GetEnvVarByUUIDParams

type GetEnvVarByUUIDParams struct {
	Uuid       pgtype.UUID
	ResourceID int64
}

type GetEnvironmentByUUIDForTeamParams

type GetEnvironmentByUUIDForTeamParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetEnvironmentByUUIDParams

type GetEnvironmentByUUIDParams struct {
	Uuid      pgtype.UUID
	ProjectID int64
}

type GetExternalEndpointByUUIDParams

type GetExternalEndpointByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetGithubAppByUUIDParams

type GetGithubAppByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetIdentityParams

type GetIdentityParams struct {
	Provider        OauthProvider
	ProviderSubject string
}

type GetIngressEndpointByUUIDParams

type GetIngressEndpointByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetJobByUUIDForTeamParams

type GetJobByUUIDForTeamParams struct {
	Uuid   pgtype.UUID
	TeamID *int64
}

type GetLastAppliedProxyRevisionParams

type GetLastAppliedProxyRevisionParams struct {
	ServerID int64
	Scope    string
}

type GetLiveExternalEndpointGrantParams

type GetLiveExternalEndpointGrantParams struct {
	EndpointID int64
	UserID     int64
}

type GetMcpAccessTokenByHashRow

type GetMcpAccessTokenByHashRow struct {
	ID                int64
	Uuid              pgtype.UUID
	TokenHash         string
	ClientID          string
	ClientName        string
	UserID            int64
	TeamID            int64
	ExpiresAt         pgtype.Timestamptz
	LastUsedAt        pgtype.Timestamptz
	RevokedAt         pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
	Role              TeamRole
	CustomRoleID      *int64
	CustomPermissions []string
}

type GetNotificationChannelByUUIDParams

type GetNotificationChannelByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetNotificationRuleByUUIDParams

type GetNotificationRuleByUUIDParams struct {
	Uuid      pgtype.UUID
	ChannelID int64
}

type GetOpenIngressSessionForEndpointRow

type GetOpenIngressSessionForEndpointRow struct {
	ID             int64
	Uuid           pgtype.UUID
	TeamID         int64
	EndpointID     *int64
	UserID         *int64
	ClientIp       *netip.Addr
	TokenHash      string
	TokenExpiresAt pgtype.Timestamptz
	ClaimedAt      pgtype.Timestamptz
	StartedAt      pgtype.Timestamptz
	LastSeenAt     pgtype.Timestamptz
	EndedAt        pgtype.Timestamptz
	EndReason      *TerminalEndReason
	CreatedAt      pgtype.Timestamptz
	UserEmail      *string
}

type GetPasskeyByCredentialIDRow

type GetPasskeyByCredentialIDRow struct {
	ID           int64
	Uuid         pgtype.UUID
	UserID       int64
	Name         string
	CredentialID []byte
	Credential   []byte
	CreatedAt    pgtype.Timestamptz
	LastUsedAt   pgtype.Timestamptz
	UserUuid     pgtype.UUID
	Email        string
	UserName     string
}

type GetPendingInvitationByTokenHashRow

type GetPendingInvitationByTokenHashRow struct {
	ID           int64
	TeamID       int64
	Email        string
	Role         TeamRole
	CustomRoleID *int64
	ExpiresAt    pgtype.Timestamptz
	TeamName     string
}

type GetPortForwardSessionByUUIDParams

type GetPortForwardSessionByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetPreviewByIdentityParams

type GetPreviewByIdentityParams struct {
	ApplicationID int64
	Provider      GitProvider
	PrID          int32
}

type GetPreviewByUUIDForTeamParams

type GetPreviewByUUIDForTeamParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetPrivateKeyByUUIDParams

type GetPrivateKeyByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID *int64
}

type GetProjectByUUIDParams

type GetProjectByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetRegistryCredentialByUUIDParams

type GetRegistryCredentialByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetRepositoryByFullNameParams

type GetRepositoryByFullNameParams struct {
	GithubAppID *int64
	FullName    string
}

type GetResourceAccessByUUIDRow

type GetResourceAccessByUUIDRow struct {
	ID               int64
	Uuid             pgtype.UUID
	TeamID           int64
	ResourceType     ResourceType
	AccessProtection PreviewProtection
}

type GetResourceByRoutedHostParams

type GetResourceByRoutedHostParams struct {
	Host        string
	RequestPath string
}

type GetResourceByRoutedHostRow

type GetResourceByRoutedHostRow struct {
	ID               int64
	Uuid             pgtype.UUID
	TeamID           int64
	ResourceType     ResourceType
	AccessProtection PreviewProtection
}

type GetResourceByUUIDForTeamParams

type GetResourceByUUIDForTeamParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetS3StorageByUUIDParams

type GetS3StorageByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetScheduledTaskByIDRow

type GetScheduledTaskByIDRow struct {
	ScheduledTask   ScheduledTask
	ApplicationUuid pgtype.UUID
}

type GetScheduledTaskByUUIDParams

type GetScheduledTaskByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetScheduledTaskByUUIDRow

type GetScheduledTaskByUUIDRow struct {
	ScheduledTask   ScheduledTask
	ApplicationUuid pgtype.UUID
}

type GetScimMemberParams

type GetScimMemberParams struct {
	TeamID int64
	Uuid   pgtype.UUID
}

type GetScimMemberRow

type GetScimMemberRow struct {
	UserID     int64
	UserUuid   pgtype.UUID
	Email      string
	Name       string
	Role       TeamRole
	ExternalID *string
}

type GetScimTokenByHashRow

type GetScimTokenByHashRow struct {
	ID       int64
	Uuid     pgtype.UUID
	TeamID   int64
	TeamUuid pgtype.UUID
}

type GetServerByUUIDParams

type GetServerByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetServiceComponentByUUIDParams

type GetServiceComponentByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetServiceStackByUUIDParams

type GetServiceStackByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetServiceStackByUUIDRow

type GetServiceStackByUUIDRow struct {
	Resource        Resource
	Service         Service
	EnvironmentUuid pgtype.UUID
	ProjectUuid     pgtype.UUID
	DestinationUuid pgtype.UUID
	ServerUuid      pgtype.UUID
	ServerRowID     int64
}

type GetSessionByTokenHashRow

type GetSessionByTokenHashRow struct {
	ID                 int64
	Uuid               pgtype.UUID
	UserID             int64
	TokenHash          string
	CurrentTeamID      *int64
	MfaVerifiedAt      pgtype.Timestamptz
	Ip                 *netip.Addr
	UserAgent          *string
	LastSeenAt         pgtype.Timestamptz
	ExpiresAt          pgtype.Timestamptz
	RevokedAt          pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
	CsrfToken          *string
	MfaPending         bool
	TotpVerifiedAt     pgtype.Timestamptz
	ViewAsRole         *TeamRole
	ViewAsCustomRoleID *int64
	Email              string
	UserName           string
	UserDeletedAt      pgtype.Timestamptz
}

type GetSharedVariableByUUIDParams

type GetSharedVariableByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetSleepingPreviewForServerParams

type GetSleepingPreviewForServerParams struct {
	Uuid     pgtype.UUID
	ServerID int64
}

type GetStorageByUUIDParams

type GetStorageByUUIDParams struct {
	Uuid       pgtype.UUID
	ResourceID int64
}

type GetTeamMemberByExternalIDParams

type GetTeamMemberByExternalIDParams struct {
	TeamID     int64
	ExternalID *string
}

type GetTeamMemberByExternalIDRow

type GetTeamMemberByExternalIDRow struct {
	MembershipID int64
	Role         TeamRole
	ExternalID   *string
	CustomRoleID *int64
	UserID       int64
	UserUuid     pgtype.UUID
	Email        string
	Name         string
}

type GetTeamMemberByUUIDParams

type GetTeamMemberByUUIDParams struct {
	TeamID   int64
	UserUuid pgtype.UUID
}

type GetTeamMemberByUUIDRow

type GetTeamMemberByUUIDRow struct {
	MembershipID   int64
	Role           TeamRole
	CustomRoleID   *int64
	JoinedAt       pgtype.Timestamptz
	UserUuid       pgtype.UUID
	Email          string
	Name           string
	CustomRoleUuid pgtype.UUID
	CustomRoleName *string
}

type GetTeamMembershipForUserParams

type GetTeamMembershipForUserParams struct {
	UserID          int64
	PreferredTeamID int64
}

type GetTeamMembershipForUserRow

type GetTeamMembershipForUserRow struct {
	TeamID            int64
	Role              TeamRole
	TeamUuid          pgtype.UUID
	TeamName          string
	IsRoot            bool
	CustomPermissions []string
	CustomRoleUuid    pgtype.UUID
	CustomRoleName    *string
}

type GetTokenCreatorAuthorityParams

type GetTokenCreatorAuthorityParams struct {
	UserID int64
	TeamID int64
}

type GetTokenCreatorAuthorityRow

type GetTokenCreatorAuthorityRow struct {
	Role              TeamRole
	UserID            int64
	CustomRoleID      *int64
	CustomPermissions []string
}

type GetUptimeCheckByUUIDParams

type GetUptimeCheckByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type GetWebhookEndpointByUUIDRow

type GetWebhookEndpointByUUIDRow struct {
	ID              int64
	Uuid            pgtype.UUID
	ApplicationID   int64
	Provider        WebhookProvider
	SecretEnc       []byte
	Enabled         bool
	CreatedBy       *int64
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	TeamID          int64
	ApplicationUuid pgtype.UUID
}

type GetWebhookEndpointForApplicationParams

type GetWebhookEndpointForApplicationParams struct {
	ApplicationID int64
	Provider      WebhookProvider
}

type GitProvider

type GitProvider string
const (
	GitProviderGithub    GitProvider = "github"
	GitProviderGitlab    GitProvider = "gitlab"
	GitProviderBitbucket GitProvider = "bitbucket"
	GitProviderGitea     GitProvider = "gitea"
	GitProviderOther     GitProvider = "other"
)

func (*GitProvider) Scan

func (e *GitProvider) Scan(src interface{}) error

type GitSource

type GitSource struct {
	ID           int64
	Uuid         pgtype.UUID
	TeamID       int64
	Name         string
	Kind         GitSourceKind
	Provider     GitProvider
	ApiUrl       *string
	HtmlUrl      *string
	PrivateKeyID *int64
	GithubAppID  *int64
	CreatedBy    *int64
	UpdatedBy    *int64
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
	Version      int32
	ApiTokenEnc  []byte
}

type GitSourceKind

type GitSourceKind string
const (
	GitSourceKindPublic    GitSourceKind = "public"
	GitSourceKindDeployKey GitSourceKind = "deploy_key"
	GitSourceKindGithubApp GitSourceKind = "github_app"
)

func (*GitSourceKind) Scan

func (e *GitSourceKind) Scan(src interface{}) error

type GithubApp

type GithubApp struct {
	ID                     int64
	Uuid                   pgtype.UUID
	TeamID                 int64
	Name                   string
	AppID                  *int64
	Slug                   *string
	InstallationID         *int64
	ClientID               *string
	ClientSecretEnc        []byte
	WebhookSecretEnc       []byte
	AppPrivateKeyEnc       []byte
	ApiUrl                 string
	HtmlUrl                string
	ManifestStateHash      *string
	ManifestStateExpiresAt pgtype.Timestamptz
	CreatedBy              *int64
	UpdatedBy              *int64
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	Version                int32
}

type HealthCheck

type HealthCheck struct {
	ID                 int64
	ResourceID         int64
	Enabled            bool
	Method             string
	Path               string
	Port               *int32
	IntervalSeconds    int32
	TimeoutSeconds     int32
	Retries            int32
	StartPeriodSeconds int32
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
}

type HeartbeatJobParams

type HeartbeatJobParams struct {
	ID           int64
	LeasedBy     *string
	LeaseSeconds int32
}

type HeartbeatPortForwardSessionParams

type HeartbeatPortForwardSessionParams struct {
	ID        int64
	AttachSeq int64
}

type HeartbeatTerminalSessionParams

type HeartbeatTerminalSessionParams struct {
	ID        int64
	AttachSeq int64
}

type IdempotencyKey

type IdempotencyKey struct {
	ID           int64
	TeamID       int64
	Key          string
	Endpoint     string
	RequestHash  string
	StatusCode   *int32
	ResponseBody []byte
	CompletedAt  pgtype.Timestamptz
	CreatedAt    pgtype.Timestamptz
}

type Identity

type Identity struct {
	ID              int64
	Uuid            pgtype.UUID
	UserID          int64
	Provider        OauthProvider
	ProviderSubject string
	Email           *string
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
}

type IngressAccess

type IngressAccess string
const (
	IngressAccessSso       IngressAccess = "sso"
	IngressAccessBasicAuth IngressAccess = "basic_auth"
	IngressAccessNone      IngressAccess = "none"
)

func (*IngressAccess) Scan

func (e *IngressAccess) Scan(src interface{}) error

type IngressEndpoint

type IngressEndpoint struct {
	ID            int64
	Uuid          pgtype.UUID
	TeamID        int64
	Name          string
	Description   *string
	Fqdn          string
	ServerID      int64
	Access        IngressAccess
	BasicAuthHash *string
	CreatedBy     *int64
	UpdatedBy     *int64
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
	Version       int32
}

type IngressTunnelSession

type IngressTunnelSession struct {
	ID             int64
	Uuid           pgtype.UUID
	TeamID         int64
	EndpointID     *int64
	UserID         *int64
	ClientIp       *netip.Addr
	TokenHash      string
	TokenExpiresAt pgtype.Timestamptz
	ClaimedAt      pgtype.Timestamptz
	StartedAt      pgtype.Timestamptz
	LastSeenAt     pgtype.Timestamptz
	EndedAt        pgtype.Timestamptz
	EndReason      *TerminalEndReason
	CreatedAt      pgtype.Timestamptz
}

type InsertAuditEventParams

type InsertAuditEventParams struct {
	TeamID        *int64
	ActorKind     ActorKind
	ActorUuid     pgtype.UUID
	ActorDisplay  *string
	Action        string
	TargetKind    *string
	TargetUuid    pgtype.UUID
	Result        AuditResult
	Ip            *netip.Addr
	UserAgent     *string
	RequestID     pgtype.UUID
	CorrelationID pgtype.UUID
	TargetName    *string
	DiffRedacted  []byte
}

type InsertInstanceSettingsIfAbsentParams

type InsertInstanceSettingsIfAbsentParams struct {
	Fqdn      *string
	Timezone  string
	AcmeEmail *string
}

type InsertOutboxEventParams

type InsertOutboxEventParams struct {
	Uuid         pgtype.UUID
	EventType    string
	TeamUuid     pgtype.UUID
	ResourceUuid pgtype.UUID
	Actor        []byte
	AggregateKey *string
	Payload      []byte
}

type InstanceSetting

type InstanceSetting struct {
	ID                          int16
	Fqdn                        *string
	Timezone                    string
	RegistrationEnabled         bool
	ApiEnabled                  bool
	DnsValidationServer         string
	TransactionalEmailConfigEnc []byte
	AutoUpdateEnabled           bool
	AutoUpdateCron              *string
	OnboardingCompletedAt       pgtype.Timestamptz
	UpdatedBy                   *int64
	CreatedAt                   pgtype.Timestamptz
	UpdatedAt                   pgtype.Timestamptz
	Version                     int32
	AcmeEmail                   *string
	LocalhostSeeded             bool
	OtlpConfigEnc               []byte
	MfaRequired                 bool
	PasswordLoginDisabled       bool
	ImageRetentionCount         int32
	McpEnabled                  bool
	McpDcrEnabled               bool
}

type Invitation

type Invitation struct {
	ID           int64
	Uuid         pgtype.UUID
	TeamID       int64
	Email        string
	Role         TeamRole
	TokenHash    string
	InvitedBy    *int64
	ExpiresAt    pgtype.Timestamptz
	AcceptedAt   pgtype.Timestamptz
	RevokedAt    pgtype.Timestamptz
	CreatedAt    pgtype.Timestamptz
	CustomRoleID *int64
}

type Job

type Job struct {
	ID                int64
	Uuid              pgtype.UUID
	Queue             string
	JobType           string
	Payload           []byte
	Status            JobStatus
	Priority          int32
	RunAt             pgtype.Timestamptz
	Attempt           int32
	MaxAttempts       int32
	IdempotencyKey    *string
	LockKey           *string
	LeasedBy          *string
	LeaseExpiresAt    pgtype.Timestamptz
	HeartbeatAt       pgtype.Timestamptz
	CancelRequestedAt pgtype.Timestamptz
	LastError         *string
	Steps             []byte
	Result            []byte
	RetryOfID         *int64
	TeamID            *int64
	ResourceID        *int64
	CorrelationID     pgtype.UUID
	DeadLetteredAt    pgtype.Timestamptz
	FinishedAt        pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	ResumeCount       int32
}

type JobStatus

type JobStatus string
const (
	JobStatusScheduled  JobStatus = "scheduled"
	JobStatusQueued     JobStatus = "queued"
	JobStatusLeased     JobStatus = "leased"
	JobStatusRunning    JobStatus = "running"
	JobStatusRetryWait  JobStatus = "retry_wait"
	JobStatusSucceeded  JobStatus = "succeeded"
	JobStatusCancelled  JobStatus = "cancelled"
	JobStatusDeadLetter JobStatus = "dead_letter"
)

func (*JobStatus) Scan

func (e *JobStatus) Scan(src interface{}) error

type ListAdoptionScansForServerParams

type ListAdoptionScansForServerParams struct {
	ServerID  int64
	BeforeID  *int64
	PageLimit int32
}

type ListApiTokensPageParams

type ListApiTokensPageParams struct {
	TeamID    int64
	CreatedBy *int64
	AfterID   int64
	PageLimit int32
}

type ListApiTokensPageRow

type ListApiTokensPageRow struct {
	ID          int64
	Uuid        pgtype.UUID
	TeamID      int64
	CreatedBy   *int64
	Name        string
	TokenPrefix string
	TokenHash   string
	Permissions []string
	IpAllowlist []netip.Prefix
	ExpiresAt   pgtype.Timestamptz
	LastUsedAt  pgtype.Timestamptz
	RevokedAt   pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	OwnerEmail  *string
}

type ListAppArtifactsOnServerParams

type ListAppArtifactsOnServerParams struct {
	ResourceID int64
	ServerID   *int64
}

type ListAppArtifactsOnServerRow

type ListAppArtifactsOnServerRow struct {
	ID        int64
	ImageName string
	ImageTag  *string
}

type ListApplicationIDsForRepositoryPushParams

type ListApplicationIDsForRepositoryPushParams struct {
	GithubAppID *int64
	ExternalID  string
}

type ListApplicationsByTagsParams

type ListApplicationsByTagsParams struct {
	TeamID   int64
	TagNames []string
}

type ListApplicationsPageParams

type ListApplicationsPageParams struct {
	TeamID          int64
	ProjectUuid     pgtype.UUID
	EnvironmentUuid pgtype.UUID
	ServerUuid      pgtype.UUID
	AfterID         int64
	PageLimit       int32
}

type ListApplicationsPageRow

type ListApplicationsPageRow struct {
	Resource                   Resource
	Application                Application
	BuildConfig                BuildConfig
	RuntimeConfig              RuntimeConfig
	EnvironmentUuid            pgtype.UUID
	ProjectUuid                pgtype.UUID
	DestinationUuid            pgtype.UUID
	ServerUuid                 pgtype.UUID
	ServerRowID                int64
	PrivateKeyUuid             pgtype.UUID
	RegistryCredentialUuid     pgtype.UUID
	PushRegistryCredentialUuid pgtype.UUID
	GitApiTokenSet             bool
	GitApiUrl                  *string
	GithubAppUuid              pgtype.UUID
}

type ListApplicationsToSleepRow

type ListApplicationsToSleepRow struct {
	ID                      int64
	Uuid                    pgtype.UUID
	UpdatedAt               pgtype.Timestamptz
	ScaleToZeroAfterMinutes int32
	LastActivityAt          pgtype.Timestamptz
}

type ListAuditEventsPageParams

type ListAuditEventsPageParams struct {
	TeamID         *int64
	AfterID        int64
	Action         *string
	ActionPrefixes []string
	Result         *AuditResult
	ActorUuid      pgtype.UUID
	TargetUuid     pgtype.UUID
	FromTime       pgtype.Timestamptz
	ToTime         pgtype.Timestamptz
	PageLimit      int32
}

type ListBackupExecutionsPageParams

type ListBackupExecutionsPageParams struct {
	PlanID    int64
	AfterID   int64
	PageLimit int32
}

type ListCancellablePreviewDeploymentIDsParams

type ListCancellablePreviewDeploymentIDsParams struct {
	PreviewID *int64
	ID        int64
}

type ListCertificatesForServerParams

type ListCertificatesForServerParams struct {
	ServerID           int64
	ExpiringWithinDays *int32
}

type ListCertificatesToAlertRow

type ListCertificatesToAlertRow struct {
	ID                     int64
	Uuid                   pgtype.UUID
	ServerID               int64
	Kind                   CertificateKind
	MainDomain             string
	Sans                   []string
	Issuer                 *string
	NotBefore              pgtype.Timestamptz
	NotAfter               pgtype.Timestamptz
	Status                 CertificateStatus
	LastError              *string
	DnsProvider            *string
	DnsCredentialID        *int64
	CertPath               *string
	KeyPath                *string
	ObservedAt             pgtype.Timestamptz
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	ExpiryAlertedThreshold *int32
	ExpiryAlertedAt        pgtype.Timestamptz
	ServerUuid             pgtype.UUID
	TeamUuid               pgtype.UUID
}

type ListCustomRolesPageParams

type ListCustomRolesPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListDNSCredentialsPageParams

type ListDNSCredentialsPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListDatabasesPageParams

type ListDatabasesPageParams struct {
	TeamID          int64
	EnvironmentUuid pgtype.UUID
	ServerUuid      pgtype.UUID
	AfterID         int64
	PageLimit       int32
}

type ListDatabasesPageRow

type ListDatabasesPageRow struct {
	Resource           Resource
	Database           Database
	DatabaseCredential DatabaseCredential
	EnvironmentUuid    pgtype.UUID
	ProjectUuid        pgtype.UUID
	ServerUuid         pgtype.UUID
	ServerHost         string
}

type ListDeploymentsForResourceParams

type ListDeploymentsForResourceParams struct {
	ResourceID int64
	Status     *DeploymentStatus
	AfterID    int64
	PageLimit  int32
}

type ListDeploymentsForResourceRow

type ListDeploymentsForResourceRow struct {
	Deployment Deployment
	PrID       *int32
}

type ListDigestRulesDueRow

type ListDigestRulesDueRow struct {
	ID                    int64
	Uuid                  pgtype.UUID
	ChannelID             int64
	EventType             string
	Enabled               bool
	ProjectID             *int64
	EnvironmentID         *int64
	MinSeverity           NotificationSeverity
	DebounceSeconds       int32
	QuietHoursStart       pgtype.Time
	QuietHoursEnd         pgtype.Time
	DigestEnabled         bool
	CreatedAt             pgtype.Timestamptz
	UpdatedAt             pgtype.Timestamptz
	DigestIntervalMinutes int32
	LastDigestAt          pgtype.Timestamptz
	Kind                  NotificationChannelKind
	TeamID                int64
}

type ListDrillablePlansRow

type ListDrillablePlansRow struct {
	DatabaseBackupPlan DatabaseBackupPlan
	TeamID             int64
	TargetResourceID   int64
}

type ListEnabledOauthProviderConfigsRow

type ListEnabledOauthProviderConfigsRow struct {
	Provider    OauthProvider
	DisplayName *string
}

type ListEnvVarsPageParams

type ListEnvVarsPageParams struct {
	ResourceID int64
	IsPreview  bool
	AfterID    int64
	PageLimit  int32
}

type ListEnvironmentsPageParams

type ListEnvironmentsPageParams struct {
	ProjectID int64
	AfterID   int64
	PageLimit int32
}

type ListExpiredLocalBackupsParams

type ListExpiredLocalBackupsParams struct {
	BackupPlanID int64
	KeepCount    int32
	MaxDays      int32
}

type ListExpiredLocalBackupsRow

type ListExpiredLocalBackupsRow struct {
	ID             int64
	Uuid           pgtype.UUID
	BackupPlanID   int64
	JobID          *int64
	Status         BackupExecutionStatus
	Filename       *string
	SizeBytes      *int64
	ChecksumSha256 *string
	EngineVersion  *string
	UploadedToS3   bool
	S3UploadError  *string
	S3Key          *string
	LocalDeletedAt pgtype.Timestamptz
	S3DeletedAt    pgtype.Timestamptz
	ErrorMessage   *string
	StartedAt      pgtype.Timestamptz
	FinishedAt     pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
}

type ListExpiredS3BackupsParams

type ListExpiredS3BackupsParams struct {
	BackupPlanID int64
	KeepCount    int32
	MaxDays      int32
}

type ListExpiredS3BackupsRow

type ListExpiredS3BackupsRow struct {
	ID             int64
	Uuid           pgtype.UUID
	BackupPlanID   int64
	JobID          *int64
	Status         BackupExecutionStatus
	Filename       *string
	SizeBytes      *int64
	ChecksumSha256 *string
	EngineVersion  *string
	UploadedToS3   bool
	S3UploadError  *string
	S3Key          *string
	LocalDeletedAt pgtype.Timestamptz
	S3DeletedAt    pgtype.Timestamptz
	ErrorMessage   *string
	StartedAt      pgtype.Timestamptz
	FinishedAt     pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
}

type ListExternalEndpointGrantsPageParams

type ListExternalEndpointGrantsPageParams struct {
	EndpointID int64
	BeforeID   int64
	PageLimit  int32
}

type ListExternalEndpointGrantsPageRow

type ListExternalEndpointGrantsPageRow struct {
	ID          int64
	Uuid        pgtype.UUID
	EndpointID  int64
	UserID      int64
	Reason      string
	Factor      string
	GrantedBy   *int64
	RenewedFrom *int64
	RequestedAt pgtype.Timestamptz
	ExpiresAt   pgtype.Timestamptz
	RevokedAt   pgtype.Timestamptz
	RevokedBy   *int64
	CreatedAt   pgtype.Timestamptz
	UserEmail   string
}

type ListExternalEndpointsPageParams

type ListExternalEndpointsPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListGithubAppsPageParams

type ListGithubAppsPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListIngressEndpointsRow

type ListIngressEndpointsRow struct {
	ID            int64
	Uuid          pgtype.UUID
	TeamID        int64
	Name          string
	Description   *string
	Fqdn          string
	ServerID      int64
	Access        IngressAccess
	BasicAuthHash *string
	CreatedBy     *int64
	UpdatedBy     *int64
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
	Version       int32
	ServerUuid    pgtype.UUID
	ServerName    string
}

type ListIngressSessionsPageParams

type ListIngressSessionsPageParams struct {
	TeamID     int64
	Limit      int32
	BeforeID   int64
	EndpointID *int64
	ActiveOnly bool
}

type ListIngressSessionsPageRow

type ListIngressSessionsPageRow struct {
	ID             int64
	Uuid           pgtype.UUID
	TeamID         int64
	EndpointID     *int64
	UserID         *int64
	ClientIp       *netip.Addr
	TokenHash      string
	TokenExpiresAt pgtype.Timestamptz
	ClaimedAt      pgtype.Timestamptz
	StartedAt      pgtype.Timestamptz
	LastSeenAt     pgtype.Timestamptz
	EndedAt        pgtype.Timestamptz
	EndReason      *TerminalEndReason
	CreatedAt      pgtype.Timestamptz
	UserEmail      *string
	EndpointUuid   pgtype.UUID
	EndpointName   *string
	EndpointFqdn   *string
}

type ListInstanceAuditEventsPageParams

type ListInstanceAuditEventsPageParams struct {
	AfterID   int64
	Action    *string
	Result    *AuditResult
	ActorUuid pgtype.UUID
	FromTime  pgtype.Timestamptz
	ToTime    pgtype.Timestamptz
	PageLimit int32
}

type ListInvitationsPageParams

type ListInvitationsPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListInvitationsPageRow

type ListInvitationsPageRow struct {
	ID             int64
	Uuid           pgtype.UUID
	TeamID         int64
	Email          string
	Role           TeamRole
	TokenHash      string
	InvitedBy      *int64
	ExpiresAt      pgtype.Timestamptz
	AcceptedAt     pgtype.Timestamptz
	RevokedAt      pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
	CustomRoleID   *int64
	CustomRoleUuid pgtype.UUID
	CustomRoleName *string
}

type ListJobsPageParams

type ListJobsPageParams struct {
	TeamID       *int64
	StatusFilter *JobStatus
	QueueFilter  *string
	TypeFilter   *string
	AfterID      int64
	PageLimit    int32
}

type ListNotificationChannelsPageParams

type ListNotificationChannelsPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListOutboxEventsAfterParams

type ListOutboxEventsAfterParams struct {
	ID    int64
	Limit int32
}

type ListOutboxEventsForTeamAfterParams

type ListOutboxEventsForTeamAfterParams struct {
	TeamUuid pgtype.UUID
	ID       int64
	Limit    int32
}

type ListPendingDigestDeliveriesRow

type ListPendingDigestDeliveriesRow struct {
	ID            int64
	OutboxEventID int64
	EventType     string
	ResourceUuid  pgtype.UUID
	OccurredAt    pgtype.Timestamptz
}

type ListPendingInvitationsByEmailRow

type ListPendingInvitationsByEmailRow struct {
	ID           int64
	TeamID       int64
	Role         TeamRole
	CustomRoleID *int64
}

type ListPortForwardSessionsPageParams

type ListPortForwardSessionsPageParams struct {
	TeamID     int64
	BeforeID   int64
	EndpointID *int64
	ActiveOnly bool
	PageLimit  int32
}

type ListPortForwardSessionsPageRow

type ListPortForwardSessionsPageRow struct {
	ID                 int64
	Uuid               pgtype.UUID
	TeamID             int64
	UserID             *int64
	ServerID           *int64
	ResourceID         *int64
	PreviewID          *int64
	TargetName         string
	TargetComponent    *string
	TargetPort         int32
	ClientIp           *netip.Addr
	TokenHash          string
	TokenExpiresAt     pgtype.Timestamptz
	ClaimedAt          pgtype.Timestamptz
	StartedAt          pgtype.Timestamptz
	EndedAt            pgtype.Timestamptz
	EndReason          *TerminalEndReason
	CreatedAt          pgtype.Timestamptz
	ExternalEndpointID *int64
	GrantID            *int64
	AuthorizedUntil    pgtype.Timestamptz
	LastHeartbeatAt    pgtype.Timestamptz
	AttachKeyHash      []byte
	AttachSeq          int64
	UserEmail          *string
	EndpointUuid       pgtype.UUID
}

type ListPreviewArtifactsOnServerParams

type ListPreviewArtifactsOnServerParams struct {
	PreviewID *int64
	ServerID  *int64
}

type ListPreviewArtifactsOnServerRow

type ListPreviewArtifactsOnServerRow struct {
	ID        int64
	ImageName string
	ImageTag  *string
}

type ListPreviewEnvVarsParams

type ListPreviewEnvVarsParams struct {
	ResourceID int64
	PreviewID  *int64
}

type ListPreviewsForScaleToZeroRow

type ListPreviewsForScaleToZeroRow struct {
	ID                      int64
	Uuid                    pgtype.UUID
	ApplicationID           int64
	Provider                GitProvider
	PrID                    int32
	SourceBranch            *string
	HeadSha                 *string
	IsFork                  bool
	ForkApprovedBy          *int64
	ForkApprovedAt          pgtype.Timestamptz
	Fqdn                    *string
	Status                  PreviewStatus
	CleanupError            *string
	LastDeployedAt          pgtype.Timestamptz
	LastActivityAt          pgtype.Timestamptz
	DestroyedAt             pgtype.Timestamptz
	CreatedAt               pgtype.Timestamptz
	UpdatedAt               pgtype.Timestamptz
	RepoReference           *string
	ExpiryWarnedAt          pgtype.Timestamptz
	RandomSlug              *string
	DeployRequestedAt       pgtype.Timestamptz
	ScaleToZeroAfterMinutes int32
}

type ListPrivateKeysPageParams

type ListPrivateKeysPageParams struct {
	TeamID    *int64
	AfterID   int64
	PageLimit int32
}

type ListProjectsPageParams

type ListProjectsPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListRegistryCredentialsPageParams

type ListRegistryCredentialsPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListRestoreDrillsPageParams

type ListRestoreDrillsPageParams struct {
	PlanID    int64
	AfterID   int64
	PageLimit int32
}

type ListRestoreDrillsPageRow

type ListRestoreDrillsPageRow struct {
	RestoreDrill  RestoreDrill
	ExecutionUuid pgtype.UUID
}

type ListS3StoragesPageParams

type ListS3StoragesPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListSchedulableBackupPlansRow

type ListSchedulableBackupPlansRow struct {
	ID                     int64
	Uuid                   pgtype.UUID
	DatabaseID             *int64
	ServiceComponentID     *int64
	IsInstanceBackup       bool
	Enabled                bool
	CronExpression         string
	Timezone               string
	DumpAll                bool
	IncludedDatabases      []string
	ExcludedCollections    []string
	TimeoutSeconds         int32
	S3StorageID            *int64
	S3Only                 bool
	SaveLocal              bool
	RetentionLocalMaxCount int32
	RetentionLocalMaxDays  int32
	RetentionS3MaxCount    int32
	RetentionS3MaxDays     int32
	CreatedBy              *int64
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	DeletedAt              pgtype.Timestamptz
	Version                int32
	NextRunAt              pgtype.Timestamptz
	LastRunAt              pgtype.Timestamptz
	DrillEnabled           bool
	DrillIntervalDays      int32
	LastDrillAt            pgtype.Timestamptz
	LastDrillStatus        *RestoreDrillStatus
	TeamID                 int64
	TargetResourceID       int64
}

type ListSchedulableTasksRow

type ListSchedulableTasksRow struct {
	ScheduledTask   ScheduledTask
	ApplicationUuid pgtype.UUID
}

type ListScheduledTasksPageParams

type ListScheduledTasksPageParams struct {
	ResourceID int64
	AfterID    int64
	PageLimit  int32
}

type ListScheduledTasksPageRow

type ListScheduledTasksPageRow struct {
	ScheduledTask   ScheduledTask
	ApplicationUuid pgtype.UUID
}

type ListServerDomainsRow

type ListServerDomainsRow struct {
	ResourceUuid pgtype.UUID
	ResourceType ResourceType
	Fqdn         string
	Path         string
	TargetPort   *int32
}

type ListServerResourcesPageParams

type ListServerResourcesPageParams struct {
	ServerID  int64
	AfterID   int64
	PageLimit int32
}

type ListServerResourcesPageRow

type ListServerResourcesPageRow struct {
	Uuid            pgtype.UUID
	Name            string
	ResourceType    ResourceType
	ObservedStatus  ResourceObservedStatus
	EnvironmentUuid pgtype.UUID
	ProjectUuid     pgtype.UUID
	ID              int64
}

type ListServersPageParams

type ListServersPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListServiceStacksPageParams

type ListServiceStacksPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListServiceStacksPageRow

type ListServiceStacksPageRow struct {
	Resource        Resource
	Service         Service
	EnvironmentUuid pgtype.UUID
	ProjectUuid     pgtype.UUID
	DestinationUuid pgtype.UUID
	ServerUuid      pgtype.UUID
}

type ListSharedVariablesPageParams

type ListSharedVariablesPageParams struct {
	TeamID    int64
	Scope     *SharedVariableScope
	AfterID   int64
	PageLimit int32
}

type ListSleepingApplicationsRow

type ListSleepingApplicationsRow struct {
	ID           int64
	Uuid         pgtype.UUID
	ScaleSleptAt pgtype.Timestamptz
}

type ListTaskExecutionsPageParams

type ListTaskExecutionsPageParams struct {
	TaskID    int64
	AfterID   int64
	PageLimit int32
}

type ListTeamMembersForScimRow

type ListTeamMembersForScimRow struct {
	Role           TeamRole
	ExternalID     *string
	JoinedAt       pgtype.Timestamptz
	UserUuid       pgtype.UUID
	Email          string
	Name           string
	CustomRoleUuid pgtype.UUID
	CustomRoleName *string
}

type ListTeamMembersPageParams

type ListTeamMembersPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListTeamMembersPageRow

type ListTeamMembersPageRow struct {
	MembershipID   int64
	Role           TeamRole
	JoinedAt       pgtype.Timestamptz
	UserUuid       pgtype.UUID
	Email          string
	Name           string
	CustomRoleUuid pgtype.UUID
	CustomRoleName *string
}

type ListTeamMembershipsForUserRow

type ListTeamMembershipsForUserRow struct {
	TeamID   int64
	Role     TeamRole
	TeamUuid pgtype.UUID
	TeamName string
	Personal bool
}

type ListTeamsPageParams

type ListTeamsPageParams struct {
	AfterID   int64
	PageLimit int32
}

type ListUptimeChecksPageParams

type ListUptimeChecksPageParams struct {
	TeamID    int64
	AfterID   int64
	PageLimit int32
}

type ListUptimeResultsPageParams

type ListUptimeResultsPageParams struct {
	CheckID   int64
	AfterID   int64
	PageLimit int32
}

type LogDrainKind

type LogDrainKind string
const (
	LogDrainKindNone      LogDrainKind = "none"
	LogDrainKindAxiom     LogDrainKind = "axiom"
	LogDrainKindNewRelic  LogDrainKind = "new_relic"
	LogDrainKindFluentbit LogDrainKind = "fluentbit"
)

func (*LogDrainKind) Scan

func (e *LogDrainKind) Scan(src interface{}) error

type MarkCertificateAlertedParams

type MarkCertificateAlertedParams struct {
	ID                     int64
	ExpiryAlertedThreshold *int32
}

type MarkDigestDeliveriesFailedParams

type MarkDigestDeliveriesFailedParams struct {
	LastError   *string
	DeliveryIds []int64
}

type MarkJobRunningParams

type MarkJobRunningParams struct {
	ID       int64
	LeasedBy *string
}

type MarkProxyRevisionFailedParams

type MarkProxyRevisionFailedParams struct {
	ID    int64
	Error *string
}

type MatchNotificationRulesParams

type MatchNotificationRulesParams struct {
	EventType     string
	TeamUuid      pgtype.UUID
	ProjectID     *int64
	EnvironmentID *int64
}

type MatchNotificationRulesRow

type MatchNotificationRulesRow struct {
	ID                    int64
	Uuid                  pgtype.UUID
	ChannelID             int64
	EventType             string
	Enabled               bool
	ProjectID             *int64
	EnvironmentID         *int64
	MinSeverity           NotificationSeverity
	DebounceSeconds       int32
	QuietHoursStart       pgtype.Time
	QuietHoursEnd         pgtype.Time
	DigestEnabled         bool
	CreatedAt             pgtype.Timestamptz
	UpdatedAt             pgtype.Timestamptz
	DigestIntervalMinutes int32
	LastDigestAt          pgtype.Timestamptz
	Kind                  NotificationChannelKind
	TeamID                int64
}

type McpAccessToken

type McpAccessToken struct {
	ID         int64
	Uuid       pgtype.UUID
	TokenHash  string
	ClientID   string
	ClientName string
	UserID     int64
	TeamID     int64
	ExpiresAt  pgtype.Timestamptz
	LastUsedAt pgtype.Timestamptz
	RevokedAt  pgtype.Timestamptz
	CreatedAt  pgtype.Timestamptz
}

type McpOauthClient

type McpOauthClient struct {
	ID           int64
	ClientID     string
	ClientName   string
	RedirectUris []string
	CreatedAt    pgtype.Timestamptz
}

type McpOauthCode

type McpOauthCode struct {
	ID            int64
	CodeHash      string
	ClientID      string
	UserID        int64
	TeamID        int64
	RedirectUri   string
	CodeChallenge string
	ExpiresAt     pgtype.Timestamptz
	CreatedAt     pgtype.Timestamptz
}

type MfaChallenge

type MfaChallenge struct {
	ID        int64
	TokenHash string
	UserID    int64
	CreatedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
}

type MfaFactor

type MfaFactor struct {
	ID                 int64
	Uuid               pgtype.UUID
	UserID             int64
	Type               MfaType
	SecretEnc          []byte
	RecoveryCodeHashes []string
	ConfirmedAt        pgtype.Timestamptz
	LastUsedAt         pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
}

type MfaType

type MfaType string
const (
	MfaTypeTotp MfaType = "totp"
)

func (*MfaType) Scan

func (e *MfaType) Scan(src interface{}) error

type NotificationChannel

type NotificationChannel struct {
	ID               int64
	Uuid             pgtype.UUID
	TeamID           int64
	Kind             NotificationChannelKind
	Name             string
	ConfigEnc        []byte
	UseInstanceEmail bool
	Enabled          bool
	CreatedBy        *int64
	UpdatedBy        *int64
	CreatedAt        pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
	Version          int32
}

type NotificationChannelKind

type NotificationChannelKind string
const (
	NotificationChannelKindSmtp     NotificationChannelKind = "smtp"
	NotificationChannelKindResend   NotificationChannelKind = "resend"
	NotificationChannelKindDiscord  NotificationChannelKind = "discord"
	NotificationChannelKindTelegram NotificationChannelKind = "telegram"
	NotificationChannelKindSlack    NotificationChannelKind = "slack"
	NotificationChannelKindPushover NotificationChannelKind = "pushover"
	NotificationChannelKindWebhook  NotificationChannelKind = "webhook"
)

func (*NotificationChannelKind) Scan

func (e *NotificationChannelKind) Scan(src interface{}) error

type NotificationCursor

type NotificationCursor struct {
	ID                bool
	LastOutboxEventID int64
}

type NotificationDelivery

type NotificationDelivery struct {
	ID               int64
	Uuid             pgtype.UUID
	RuleID           int64
	ChannelID        int64
	OutboxEventID    int64
	Status           NotificationDeliveryStatus
	Attempts         int32
	LastError        *string
	SuppressedReason *string
	SentAt           pgtype.Timestamptz
	CreatedAt        pgtype.Timestamptz
}

type NotificationDeliveryStatus

type NotificationDeliveryStatus string
const (
	NotificationDeliveryStatusPending    NotificationDeliveryStatus = "pending"
	NotificationDeliveryStatusSent       NotificationDeliveryStatus = "sent"
	NotificationDeliveryStatusFailed     NotificationDeliveryStatus = "failed"
	NotificationDeliveryStatusSuppressed NotificationDeliveryStatus = "suppressed"
)

func (*NotificationDeliveryStatus) Scan

func (e *NotificationDeliveryStatus) Scan(src interface{}) error

type NotificationRule

type NotificationRule struct {
	ID                    int64
	Uuid                  pgtype.UUID
	ChannelID             int64
	EventType             string
	Enabled               bool
	ProjectID             *int64
	EnvironmentID         *int64
	MinSeverity           NotificationSeverity
	DebounceSeconds       int32
	QuietHoursStart       pgtype.Time
	QuietHoursEnd         pgtype.Time
	DigestEnabled         bool
	CreatedAt             pgtype.Timestamptz
	UpdatedAt             pgtype.Timestamptz
	DigestIntervalMinutes int32
	LastDigestAt          pgtype.Timestamptz
}

type NotificationSeverity

type NotificationSeverity string
const (
	NotificationSeverityInfo     NotificationSeverity = "info"
	NotificationSeverityWarning  NotificationSeverity = "warning"
	NotificationSeverityCritical NotificationSeverity = "critical"
)

func (*NotificationSeverity) Scan

func (e *NotificationSeverity) Scan(src interface{}) error

type NullActorKind

type NullActorKind struct {
	ActorKind ActorKind
	Valid     bool // Valid is true if ActorKind is not NULL
}

func (*NullActorKind) Scan

func (ns *NullActorKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullActorKind) Value

func (ns NullActorKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullAdoptionScanStatus

type NullAdoptionScanStatus struct {
	AdoptionScanStatus AdoptionScanStatus
	Valid              bool // Valid is true if AdoptionScanStatus is not NULL
}

func (*NullAdoptionScanStatus) Scan

func (ns *NullAdoptionScanStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAdoptionScanStatus) Value

func (ns NullAdoptionScanStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullArtifactKind

type NullArtifactKind struct {
	ArtifactKind ArtifactKind
	Valid        bool // Valid is true if ArtifactKind is not NULL
}

func (*NullArtifactKind) Scan

func (ns *NullArtifactKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullArtifactKind) Value

func (ns NullArtifactKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullAuditResult

type NullAuditResult struct {
	AuditResult AuditResult
	Valid       bool // Valid is true if AuditResult is not NULL
}

func (*NullAuditResult) Scan

func (ns *NullAuditResult) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAuditResult) Value

func (ns NullAuditResult) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullBackupExecutionStatus

type NullBackupExecutionStatus struct {
	BackupExecutionStatus BackupExecutionStatus
	Valid                 bool // Valid is true if BackupExecutionStatus is not NULL
}

func (*NullBackupExecutionStatus) Scan

func (ns *NullBackupExecutionStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBackupExecutionStatus) Value

Value implements the driver Valuer interface.

type NullBuildPack

type NullBuildPack struct {
	BuildPack BuildPack
	Valid     bool // Valid is true if BuildPack is not NULL
}

func (*NullBuildPack) Scan

func (ns *NullBuildPack) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBuildPack) Value

func (ns NullBuildPack) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullCertificateKind

type NullCertificateKind struct {
	CertificateKind CertificateKind
	Valid           bool // Valid is true if CertificateKind is not NULL
}

func (*NullCertificateKind) Scan

func (ns *NullCertificateKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullCertificateKind) Value

func (ns NullCertificateKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullCertificateStatus

type NullCertificateStatus struct {
	CertificateStatus CertificateStatus
	Valid             bool // Valid is true if CertificateStatus is not NULL
}

func (*NullCertificateStatus) Scan

func (ns *NullCertificateStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullCertificateStatus) Value

func (ns NullCertificateStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullDbEngine

type NullDbEngine struct {
	DbEngine DbEngine
	Valid    bool // Valid is true if DbEngine is not NULL
}

func (*NullDbEngine) Scan

func (ns *NullDbEngine) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDbEngine) Value

func (ns NullDbEngine) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullDeploymentStatus

type NullDeploymentStatus struct {
	DeploymentStatus DeploymentStatus
	Valid            bool // Valid is true if DeploymentStatus is not NULL
}

func (*NullDeploymentStatus) Scan

func (ns *NullDeploymentStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDeploymentStatus) Value

func (ns NullDeploymentStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullDeploymentStepStatus

type NullDeploymentStepStatus struct {
	DeploymentStepStatus DeploymentStepStatus
	Valid                bool // Valid is true if DeploymentStepStatus is not NULL
}

func (*NullDeploymentStepStatus) Scan

func (ns *NullDeploymentStepStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDeploymentStepStatus) Value

Value implements the driver Valuer interface.

type NullDeploymentTrigger

type NullDeploymentTrigger struct {
	DeploymentTrigger DeploymentTrigger
	Valid             bool // Valid is true if DeploymentTrigger is not NULL
}

func (*NullDeploymentTrigger) Scan

func (ns *NullDeploymentTrigger) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDeploymentTrigger) Value

func (ns NullDeploymentTrigger) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullExternalEndpointCriticality

type NullExternalEndpointCriticality struct {
	ExternalEndpointCriticality ExternalEndpointCriticality
	Valid                       bool // Valid is true if ExternalEndpointCriticality is not NULL
}

func (*NullExternalEndpointCriticality) Scan

func (ns *NullExternalEndpointCriticality) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullExternalEndpointCriticality) Value

Value implements the driver Valuer interface.

type NullGitProvider

type NullGitProvider struct {
	GitProvider GitProvider
	Valid       bool // Valid is true if GitProvider is not NULL
}

func (*NullGitProvider) Scan

func (ns *NullGitProvider) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullGitProvider) Value

func (ns NullGitProvider) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullGitSourceKind

type NullGitSourceKind struct {
	GitSourceKind GitSourceKind
	Valid         bool // Valid is true if GitSourceKind is not NULL
}

func (*NullGitSourceKind) Scan

func (ns *NullGitSourceKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullGitSourceKind) Value

func (ns NullGitSourceKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullIngressAccess

type NullIngressAccess struct {
	IngressAccess IngressAccess
	Valid         bool // Valid is true if IngressAccess is not NULL
}

func (*NullIngressAccess) Scan

func (ns *NullIngressAccess) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullIngressAccess) Value

func (ns NullIngressAccess) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullJobStatus

type NullJobStatus struct {
	JobStatus JobStatus
	Valid     bool // Valid is true if JobStatus is not NULL
}

func (*NullJobStatus) Scan

func (ns *NullJobStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullJobStatus) Value

func (ns NullJobStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullLogDrainKind

type NullLogDrainKind struct {
	LogDrainKind LogDrainKind
	Valid        bool // Valid is true if LogDrainKind is not NULL
}

func (*NullLogDrainKind) Scan

func (ns *NullLogDrainKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullLogDrainKind) Value

func (ns NullLogDrainKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullMfaType

type NullMfaType struct {
	MfaType MfaType
	Valid   bool // Valid is true if MfaType is not NULL
}

func (*NullMfaType) Scan

func (ns *NullMfaType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullMfaType) Value

func (ns NullMfaType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullNotificationChannelKind

type NullNotificationChannelKind struct {
	NotificationChannelKind NotificationChannelKind
	Valid                   bool // Valid is true if NotificationChannelKind is not NULL
}

func (*NullNotificationChannelKind) Scan

func (ns *NullNotificationChannelKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullNotificationChannelKind) Value

Value implements the driver Valuer interface.

type NullNotificationDeliveryStatus

type NullNotificationDeliveryStatus struct {
	NotificationDeliveryStatus NotificationDeliveryStatus
	Valid                      bool // Valid is true if NotificationDeliveryStatus is not NULL
}

func (*NullNotificationDeliveryStatus) Scan

func (ns *NullNotificationDeliveryStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullNotificationDeliveryStatus) Value

Value implements the driver Valuer interface.

type NullNotificationSeverity

type NullNotificationSeverity struct {
	NotificationSeverity NotificationSeverity
	Valid                bool // Valid is true if NotificationSeverity is not NULL
}

func (*NullNotificationSeverity) Scan

func (ns *NullNotificationSeverity) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullNotificationSeverity) Value

Value implements the driver Valuer interface.

type NullOauthProvider

type NullOauthProvider struct {
	OauthProvider OauthProvider
	Valid         bool // Valid is true if OauthProvider is not NULL
}

func (*NullOauthProvider) Scan

func (ns *NullOauthProvider) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullOauthProvider) Value

func (ns NullOauthProvider) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPreviewProtection

type NullPreviewProtection struct {
	PreviewProtection PreviewProtection
	Valid             bool // Valid is true if PreviewProtection is not NULL
}

func (*NullPreviewProtection) Scan

func (ns *NullPreviewProtection) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPreviewProtection) Value

func (ns NullPreviewProtection) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPreviewStatus

type NullPreviewStatus struct {
	PreviewStatus PreviewStatus
	Valid         bool // Valid is true if PreviewStatus is not NULL
}

func (*NullPreviewStatus) Scan

func (ns *NullPreviewStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPreviewStatus) Value

func (ns NullPreviewStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullProxyDesiredState

type NullProxyDesiredState struct {
	ProxyDesiredState ProxyDesiredState
	Valid             bool // Valid is true if ProxyDesiredState is not NULL
}

func (*NullProxyDesiredState) Scan

func (ns *NullProxyDesiredState) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullProxyDesiredState) Value

func (ns NullProxyDesiredState) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullProxyRevisionStatus

type NullProxyRevisionStatus struct {
	ProxyRevisionStatus ProxyRevisionStatus
	Valid               bool // Valid is true if ProxyRevisionStatus is not NULL
}

func (*NullProxyRevisionStatus) Scan

func (ns *NullProxyRevisionStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullProxyRevisionStatus) Value

func (ns NullProxyRevisionStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullProxyType

type NullProxyType struct {
	ProxyType ProxyType
	Valid     bool // Valid is true if ProxyType is not NULL
}

func (*NullProxyType) Scan

func (ns *NullProxyType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullProxyType) Value

func (ns NullProxyType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPublicAccessMode

type NullPublicAccessMode struct {
	PublicAccessMode PublicAccessMode
	Valid            bool // Valid is true if PublicAccessMode is not NULL
}

func (*NullPublicAccessMode) Scan

func (ns *NullPublicAccessMode) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPublicAccessMode) Value

func (ns NullPublicAccessMode) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRedirectDirection

type NullRedirectDirection struct {
	RedirectDirection RedirectDirection
	Valid             bool // Valid is true if RedirectDirection is not NULL
}

func (*NullRedirectDirection) Scan

func (ns *NullRedirectDirection) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRedirectDirection) Value

func (ns NullRedirectDirection) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullResourceDesiredStatus

type NullResourceDesiredStatus struct {
	ResourceDesiredStatus ResourceDesiredStatus
	Valid                 bool // Valid is true if ResourceDesiredStatus is not NULL
}

func (*NullResourceDesiredStatus) Scan

func (ns *NullResourceDesiredStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullResourceDesiredStatus) Value

Value implements the driver Valuer interface.

type NullResourceObservedStatus

type NullResourceObservedStatus struct {
	ResourceObservedStatus ResourceObservedStatus
	Valid                  bool // Valid is true if ResourceObservedStatus is not NULL
}

func (*NullResourceObservedStatus) Scan

func (ns *NullResourceObservedStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullResourceObservedStatus) Value

Value implements the driver Valuer interface.

type NullResourceType

type NullResourceType struct {
	ResourceType ResourceType
	Valid        bool // Valid is true if ResourceType is not NULL
}

func (*NullResourceType) Scan

func (ns *NullResourceType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullResourceType) Value

func (ns NullResourceType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRestoreDrillStatus

type NullRestoreDrillStatus struct {
	RestoreDrillStatus RestoreDrillStatus
	Valid              bool // Valid is true if RestoreDrillStatus is not NULL
}

func (*NullRestoreDrillStatus) Scan

func (ns *NullRestoreDrillStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRestoreDrillStatus) Value

func (ns NullRestoreDrillStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullServerStatus

type NullServerStatus struct {
	ServerStatus ServerStatus
	Valid        bool // Valid is true if ServerStatus is not NULL
}

func (*NullServerStatus) Scan

func (ns *NullServerStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullServerStatus) Value

func (ns NullServerStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullSharedVariableScope

type NullSharedVariableScope struct {
	SharedVariableScope SharedVariableScope
	Valid               bool // Valid is true if SharedVariableScope is not NULL
}

func (*NullSharedVariableScope) Scan

func (ns *NullSharedVariableScope) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullSharedVariableScope) Value

func (ns NullSharedVariableScope) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullStorageKind

type NullStorageKind struct {
	StorageKind StorageKind
	Valid       bool // Valid is true if StorageKind is not NULL
}

func (*NullStorageKind) Scan

func (ns *NullStorageKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullStorageKind) Value

func (ns NullStorageKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTaskExecutionStatus

type NullTaskExecutionStatus struct {
	TaskExecutionStatus TaskExecutionStatus
	Valid               bool // Valid is true if TaskExecutionStatus is not NULL
}

func (*NullTaskExecutionStatus) Scan

func (ns *NullTaskExecutionStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTaskExecutionStatus) Value

func (ns NullTaskExecutionStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTaskKind

type NullTaskKind struct {
	TaskKind TaskKind
	Valid    bool // Valid is true if TaskKind is not NULL
}

func (*NullTaskKind) Scan

func (ns *NullTaskKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTaskKind) Value

func (ns NullTaskKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTaskMissedRunPolicy

type NullTaskMissedRunPolicy struct {
	TaskMissedRunPolicy TaskMissedRunPolicy
	Valid               bool // Valid is true if TaskMissedRunPolicy is not NULL
}

func (*NullTaskMissedRunPolicy) Scan

func (ns *NullTaskMissedRunPolicy) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTaskMissedRunPolicy) Value

func (ns NullTaskMissedRunPolicy) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTaskOverlapPolicy

type NullTaskOverlapPolicy struct {
	TaskOverlapPolicy TaskOverlapPolicy
	Valid             bool // Valid is true if TaskOverlapPolicy is not NULL
}

func (*NullTaskOverlapPolicy) Scan

func (ns *NullTaskOverlapPolicy) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTaskOverlapPolicy) Value

func (ns NullTaskOverlapPolicy) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTeamRole

type NullTeamRole struct {
	TeamRole TeamRole
	Valid    bool // Valid is true if TeamRole is not NULL
}

func (*NullTeamRole) Scan

func (ns *NullTeamRole) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTeamRole) Value

func (ns NullTeamRole) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTerminalEndReason

type NullTerminalEndReason struct {
	TerminalEndReason TerminalEndReason
	Valid             bool // Valid is true if TerminalEndReason is not NULL
}

func (*NullTerminalEndReason) Scan

func (ns *NullTerminalEndReason) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTerminalEndReason) Value

func (ns NullTerminalEndReason) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTerminalTarget

type NullTerminalTarget struct {
	TerminalTarget TerminalTarget
	Valid          bool // Valid is true if TerminalTarget is not NULL
}

func (*NullTerminalTarget) Scan

func (ns *NullTerminalTarget) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTerminalTarget) Value

func (ns NullTerminalTarget) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUptimeCheckKind

type NullUptimeCheckKind struct {
	UptimeCheckKind UptimeCheckKind
	Valid           bool // Valid is true if UptimeCheckKind is not NULL
}

func (*NullUptimeCheckKind) Scan

func (ns *NullUptimeCheckKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUptimeCheckKind) Value

func (ns NullUptimeCheckKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUptimeStatus

type NullUptimeStatus struct {
	UptimeStatus UptimeStatus
	Valid        bool // Valid is true if UptimeStatus is not NULL
}

func (*NullUptimeStatus) Scan

func (ns *NullUptimeStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUptimeStatus) Value

func (ns NullUptimeStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullWebhookDeliveryStatus

type NullWebhookDeliveryStatus struct {
	WebhookDeliveryStatus WebhookDeliveryStatus
	Valid                 bool // Valid is true if WebhookDeliveryStatus is not NULL
}

func (*NullWebhookDeliveryStatus) Scan

func (ns *NullWebhookDeliveryStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullWebhookDeliveryStatus) Value

Value implements the driver Valuer interface.

type NullWebhookProvider

type NullWebhookProvider struct {
	WebhookProvider WebhookProvider
	Valid           bool // Valid is true if WebhookProvider is not NULL
}

func (*NullWebhookProvider) Scan

func (ns *NullWebhookProvider) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullWebhookProvider) Value

func (ns NullWebhookProvider) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type OauthLoginState

type OauthLoginState struct {
	ID           int64
	StateHash    string
	Provider     OauthProvider
	Purpose      string
	UserID       *int64
	PkceVerifier string
	Nonce        string
	CreatedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
}

type OauthProvider

type OauthProvider string
const (
	OauthProviderGithub    OauthProvider = "github"
	OauthProviderGitlab    OauthProvider = "gitlab"
	OauthProviderGoogle    OauthProvider = "google"
	OauthProviderAzure     OauthProvider = "azure"
	OauthProviderBitbucket OauthProvider = "bitbucket"
	OauthProviderOidc      OauthProvider = "oidc"
)

func (*OauthProvider) Scan

func (e *OauthProvider) Scan(src interface{}) error

type OauthProviderConfig

type OauthProviderConfig struct {
	ID              int64
	Uuid            pgtype.UUID
	Provider        OauthProvider
	DisplayName     *string
	ClientID        string
	ClientSecretEnc []byte
	IssuerUrl       *string
	Enabled         bool
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
}

type OutboxEvent

type OutboxEvent struct {
	ID              int64
	Uuid            pgtype.UUID
	EventType       string
	OccurredAt      pgtype.Timestamptz
	TeamUuid        pgtype.UUID
	ResourceUuid    pgtype.UUID
	Actor           []byte
	CorrelationID   pgtype.UUID
	AggregateKey    *string
	Payload         []byte
	PublishedAt     pgtype.Timestamptz
	PublishAttempts int32
	CreatedAt       pgtype.Timestamptz
}

type PasskeyCeremony

type PasskeyCeremony struct {
	ID        int64
	TokenHash string
	Purpose   string
	UserID    *int64
	Data      []byte
	CreatedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
}

type PasskeyCredential

type PasskeyCredential struct {
	ID           int64
	Uuid         pgtype.UUID
	UserID       int64
	Name         string
	CredentialID []byte
	Credential   []byte
	CreatedAt    pgtype.Timestamptz
	LastUsedAt   pgtype.Timestamptz
}

type PersistentStorage

type PersistentStorage struct {
	ID           int64
	Uuid         pgtype.UUID
	ResourceID   int64
	Kind         StorageKind
	Name         *string
	HostPath     *string
	MountPath    string
	Content      *string
	IsDirectory  bool
	FileMode     *string
	OwnerUid     *int32
	GroupGid     *int32
	CreatedBy    *int64
	UpdatedBy    *int64
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
	ExternalName *string
	IsGenerated  bool
}

type PinServerHostKeyParams

type PinServerHostKeyParams struct {
	ID                 int64
	HostKeyFingerprint *string
}

type PortForwardSession

type PortForwardSession struct {
	ID                 int64
	Uuid               pgtype.UUID
	TeamID             int64
	UserID             *int64
	ServerID           *int64
	ResourceID         *int64
	PreviewID          *int64
	TargetName         string
	TargetComponent    *string
	TargetPort         int32
	ClientIp           *netip.Addr
	TokenHash          string
	TokenExpiresAt     pgtype.Timestamptz
	ClaimedAt          pgtype.Timestamptz
	StartedAt          pgtype.Timestamptz
	EndedAt            pgtype.Timestamptz
	EndReason          *TerminalEndReason
	CreatedAt          pgtype.Timestamptz
	ExternalEndpointID *int64
	GrantID            *int64
	AuthorizedUntil    pgtype.Timestamptz
	LastHeartbeatAt    pgtype.Timestamptz
	AttachKeyHash      []byte
	AttachSeq          int64
}

type Preview

type Preview struct {
	ID                int64
	Uuid              pgtype.UUID
	ApplicationID     int64
	Provider          GitProvider
	PrID              int32
	SourceBranch      *string
	HeadSha           *string
	IsFork            bool
	ForkApprovedBy    *int64
	ForkApprovedAt    pgtype.Timestamptz
	Fqdn              *string
	Status            PreviewStatus
	CleanupError      *string
	LastDeployedAt    pgtype.Timestamptz
	LastActivityAt    pgtype.Timestamptz
	DestroyedAt       pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	RepoReference     *string
	ExpiryWarnedAt    pgtype.Timestamptz
	RandomSlug        *string
	DeployRequestedAt pgtype.Timestamptz
}

type PreviewAccessToken

type PreviewAccessToken struct {
	ID                int64
	TokenHash         string
	PreviewID         *int64
	UserID            *int64
	ExpiresAt         pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
	ApplicationID     *int64
	ResourceID        *int64
	IngressEndpointID *int64
}

type PreviewProtection

type PreviewProtection string
const (
	PreviewProtectionNone       PreviewProtection = "none"
	PreviewProtectionBasicAuth  PreviewProtection = "basic_auth"
	PreviewProtectionSignedLink PreviewProtection = "signed_link"
	PreviewProtectionSso        PreviewProtection = "sso"
)

func (*PreviewProtection) Scan

func (e *PreviewProtection) Scan(src interface{}) error

type PreviewStatus

type PreviewStatus string
const (
	PreviewStatusQueued        PreviewStatus = "queued"
	PreviewStatusDeploying     PreviewStatus = "deploying"
	PreviewStatusActive        PreviewStatus = "active"
	PreviewStatusFailed        PreviewStatus = "failed"
	PreviewStatusDestroying    PreviewStatus = "destroying"
	PreviewStatusCleanupFailed PreviewStatus = "cleanup_failed"
	PreviewStatusDestroyed     PreviewStatus = "destroyed"
	PreviewStatusSleeping      PreviewStatus = "sleeping"
	PreviewStatusWaking        PreviewStatus = "waking"
)

func (*PreviewStatus) Scan

func (e *PreviewStatus) Scan(src interface{}) error

type PrivateKey

type PrivateKey struct {
	ID                int64
	Uuid              pgtype.UUID
	TeamID            *int64
	Name              string
	Description       *string
	FingerprintSha256 string
	PublicKey         string
	PrivateKeyEnc     []byte
	CreatedBy         *int64
	UpdatedBy         *int64
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Version           int32
	IsInstance        bool
}

type Project

type Project struct {
	ID          int64
	Uuid        pgtype.UUID
	TeamID      int64
	Name        string
	Slug        string
	Description *string
	CreatedBy   *int64
	UpdatedBy   *int64
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	Version     int32
}

type ProxyConfigRevision

type ProxyConfigRevision struct {
	ID             int64
	Uuid           pgtype.UUID
	ServerID       int64
	Revision       int32
	Scope          string
	ProxyType      ProxyType
	ChecksumSha256 string
	Content        string
	Status         ProxyRevisionStatus
	Error          *string
	AppliedAt      pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
}

type ProxyDesiredState

type ProxyDesiredState string
const (
	ProxyDesiredStateRunning ProxyDesiredState = "running"
	ProxyDesiredStateStopped ProxyDesiredState = "stopped"
)

func (*ProxyDesiredState) Scan

func (e *ProxyDesiredState) Scan(src interface{}) error

type ProxyRevisionStatus

type ProxyRevisionStatus string
const (
	ProxyRevisionStatusGenerated  ProxyRevisionStatus = "generated"
	ProxyRevisionStatusApplied    ProxyRevisionStatus = "applied"
	ProxyRevisionStatusFailed     ProxyRevisionStatus = "failed"
	ProxyRevisionStatusRolledBack ProxyRevisionStatus = "rolled_back"
)

func (*ProxyRevisionStatus) Scan

func (e *ProxyRevisionStatus) Scan(src interface{}) error

type ProxyType

type ProxyType string
const (
	ProxyTypeTraefik ProxyType = "traefik"
	ProxyTypeCaddy   ProxyType = "caddy"
	ProxyTypeNone    ProxyType = "none"
)

func (*ProxyType) Scan

func (e *ProxyType) Scan(src interface{}) error

type PublicAccessMode

type PublicAccessMode string
const (
	PublicAccessModePortMapping PublicAccessMode = "port_mapping"
	PublicAccessModeTcpProxy    PublicAccessMode = "tcp_proxy"
)

func (*PublicAccessMode) Scan

func (e *PublicAccessMode) Scan(src interface{}) error

type Querier

type Querier interface {
	// Atomically claim a still-pending invitation by its link hash: the WHERE clause
	// is the single-use guard (accepted/revoked/expired all fail to match). Returns
	// the target team, role and optional custom role so the caller can add the
	// membership. Team-scoping is inherent — the invitation names its own team.
	AcceptInvitation(ctx context.Context, tokenHash string) (AcceptInvitationRow, error)
	// Atomically claim one pending invitation by id (the email-based signup already
	// matched the address). Same single-use guard as AcceptInvitation; no match
	// when it was revoked or expired between the listing and the claim.
	AcceptInvitationByID(ctx context.Context, id int64) (AcceptInvitationByIDRow, error)
	AddTeamMember(ctx context.Context, arg AddTeamMemberParams) error
	// Bind the pending request to the approving user/team and permissions.
	ApproveCliAuthCode(ctx context.Context, arg ApproveCliAuthCodeParams) (int64, error)
	ApprovePreviewFork(ctx context.Context, arg ApprovePreviewForkParams) (int64, error)
	// A build server is another mutation target of the deployment. Reserve it
	// through the same reader/writer exclusion as the deployment server, before
	// opening SSH or creating its working directory.
	AssignDeploymentBuildServerUnlessCleanupRunning(ctx context.Context, arg AssignDeploymentBuildServerUnlessCleanupRunningParams) (int64, error)
	// Reader/writer exclusion for §3.7. The cleanup job is already `running` when
	// it reaches this query. Locking the server row makes this check atomic with
	// StartDeploymentUnlessCleanupRunning: either the cleanup observes an active
	// deployment and defers, or a queued deployment observes the running cleanup
	// and waits before its first mutation. Queued deployments do not block a
	// cleanup because they have not touched the server yet.
	CanStartServerCleanup(ctx context.Context, serverID int64) (bool, error)
	CancelJobsForDeployments(ctx context.Context, deploymentIds []int64) error
	CancelQueuedDeployment(ctx context.Context, id int64) (int64, error)
	// HTTP idempotency (§24.1).
	// Inserts the key, or returns the existing row when the key was already
	// used: the caller compares the request hash and replays the response.
	ClaimIdempotencyKey(ctx context.Context, arg ClaimIdempotencyKeyParams) (ClaimIdempotencyKeyRow, error)
	// Idempotent within the TTL, bound to the attacher (ADR-065): a first claim
	// stamps the attacher's key hash, a re-claim must present the same one, and a
	// different one matches zero rows — which is the replay the rule exists to
	// stop. What one mint authorizes is one live SESSION, not one HTTP request; the
	// ladder above this statement (ADR-064) retries, and a rung that gave up must
	// not have destroyed what it was trying to open.
	//
	// The right-hand sides read pre-update values, so claimed_at and started_at are
	// pinned to the FIRST claim: a retry loop must not be able to buy itself extra
	// duration by restarting the max-duration ceiling.
	//
	// authorized_until is checked here as well as at mint (ADR-045). A grant revoked
	// between two rungs already ends the row, so `ended_at IS NULL` catches it; this
	// is the belt to that brace, because a re-claim is the one path that can arrive
	// after an authorization changed.
	ClaimPortForwardSession(ctx context.Context, arg ClaimPortForwardSessionParams) (PortForwardSession, error)
	// Idempotent within the TTL, bound to the attacher (ADR-065): a first claim
	// stamps the attacher's key hash, a re-claim must present the same one, a
	// different one matches zero rows — which is the replay the rule exists to
	// stop. The idempotence lives in the WHERE and nowhere else: read-then-write
	// would race two rungs of the same ladder into two attaches that both believe
	// they own the session, the one failure mode strict single-use never had.
	//
	// started_at is reset at claim time so idle/max-duration windows measure the
	// live session, not the gap between issuance and attach — but only on the
	// FIRST claim. The right-hand sides read pre-update values, so coalesce and the
	// attach_seq test pin both stamps to that claim; a retry loop must not buy
	// itself duration. token_expires_at > now() is unchanged and is the whole of
	// the re-claim window: there is no new lifetime here.
	//
	// last_heartbeat_at is stamped here as well as on every beat (ADR-067 §1): the
	// column means "the last moment this session was known alive", and a claim is
	// such a moment. Leaving it NULL until the first beat twenty seconds later
	// would make a shell that attached a second ago indistinguishable from a row
	// written by a release that cannot heartbeat at all.
	ClaimTerminalSession(ctx context.Context, arg ClaimTerminalSessionParams) (TerminalSession, error)
	// Outbox publisher (§18.2, §24.2): events are published in commit order.
	ClaimUnpublishedOutboxEvents(ctx context.Context, limit int32) ([]OutboxEvent, error)
	ClearFailedLogins(ctx context.Context, id int64) error
	// installation deleted/suspended (§2.4): the source is degraded, not removed.
	ClearGithubAppInstallation(ctx context.Context, id int64) (int64, error)
	// Lift the forced-enrollment gate on all of a user's sessions once they confirm
	// an MFA factor (ADR — mfa_required).
	ClearMfaPendingForUser(ctx context.Context, userID int64) error
	// The normalizing deployment converged the remote objects onto the
	// uuid-derived names (§20.7): the pointer is obsolete, the history stays.
	ClearResourceAdoption(ctx context.Context, id int64) error
	ClearResourceTags(ctx context.Context, resourceID int64) error
	// A custom role that stops existing must not leave sessions simulating it. The
	// FK already nulls the id; this clears the sessions of a role whose permissions
	// changed enough that the simulation is stale.
	ClearViewAsForCustomRole(ctx context.Context, viewAsCustomRoleID *int64) (int64, error)
	CompleteAdoptionScan(ctx context.Context, arg CompleteAdoptionScanParams) error
	// Conversion (protocols §2.1 step 5): persist what GitHub returned, clear the
	// state so the callback cannot be replayed.
	CompleteGithubAppConversion(ctx context.Context, arg CompleteGithubAppConversionParams) (GithubApp, error)
	CompleteIdempotencyKey(ctx context.Context, arg CompleteIdempotencyKeyParams) error
	// The first valid code turns the factor on and seeds the recovery codes.
	// last_used_at is set to the matched TOTP step so that very first code is
	// already replay-protected.
	ConfirmMfaFactor(ctx context.Context, arg ConfirmMfaFactorParams) (MfaFactor, error)
	// Single-use: the token exchange claims the approved request atomically.
	ConsumeCliAuthCode(ctx context.Context, requestIDHash string) (CliAuthorizationCode, error)
	// DELETE ... RETURNING on success only: two concurrent verifications of the
	// same challenge cannot both mint a session.
	ConsumeMfaChallenge(ctx context.Context, tokenHash string) (MfaChallenge, error)
	// Single-use by construction: the matched hash is removed in the same
	// statement that accepts it.
	ConsumeMfaRecoveryCode(ctx context.Context, arg ConsumeMfaRecoveryCodeParams) (int64, error)
	// DELETE ... RETURNING: the state is single-use by construction — a replayed
	// callback finds nothing, whatever the caller does. Provider and purpose are
	// part of the lookup, not hints: a GitHub login state must not complete a
	// Google callback, nor a login state a link.
	ConsumeOauthLoginState(ctx context.Context, arg ConsumeOauthLoginStateParams) (OauthLoginState, error)
	// DELETE ... RETURNING makes the ceremony single-use by construction: two
	// concurrent finishes cannot both win, whatever the caller does.
	ConsumePasskeyCeremony(ctx context.Context, arg ConsumePasskeyCeremonyParams) (PasskeyCeremony, error)
	CountActiveDeploymentsForServer(ctx context.Context, serverID int64) (int64, error)
	CountActiveJobsByLockKey(ctx context.Context, lockKey *string) (int64, error)
	// Applications cloning through a deploy key backed by this key. A key still
	// in use is not deletable (§19.2) — reported as a conflict, not as a foreign
	// key error.
	CountApplicationsUsingPrivateKey(ctx context.Context, privateKeyID *int64) (int64, error)
	CountAuditEvents(ctx context.Context) (int64, error)
	CountBackupPlansUsingS3Storage(ctx context.Context, s3StorageID *int64) (int64, error)
	// How many ways this user can still sign in: a password, federated
	// identities, passkeys. Unlinking the LAST one would lock the account out
	// silently — the caller refuses when this reaches one.
	CountCredentialsForUser(ctx context.Context, id int64) (int32, error)
	CountCustomRoleMembers(ctx context.Context, customRoleID *int64) (int64, error)
	CountDNSCredentialUsage(ctx context.Context, dnsCredentialID *int64) (int64, error)
	// The concurrency cap (§20.4.3) counts everything that consumes the server.
	CountLivePreviewsForApplication(ctx context.Context, applicationID int64) (int64, error)
	CountOpenIngressSessions(ctx context.Context, teamID int64) (int64, error)
	CountOpenPortForwardSessions(ctx context.Context, teamID int64) (int64, error)
	// Live sessions plus still-claimable tokens: both hold a slot of the per-team
	// cap, otherwise issuing tokens in a burst would bypass it.
	CountOpenTerminalSessions(ctx context.Context, teamID int64) (int64, error)
	// A passkey requires user verification (possession + biometric/PIN), so it is
	// an MFA-grade factor in its own right: forced MFA enrolment (§10.2) is
	// satisfied by one, not only by a TOTP secret.
	CountPasskeysForUser(ctx context.Context, userID int64) (int64, error)
	// A credential still referenced by a build config or by a rollback artifact
	// cannot be deleted: the deployment that depends on it would stop being able
	// to pull its own image (§19.2).
	CountRegistryCredentialUsage(ctx context.Context, credentialID *int64) (int32, error)
	// Live resources per environment, in one round trip: a per-row count would fan
	// out into one query per environment on every project listing.
	CountResourcesByEnvironment(ctx context.Context, environmentIds []int64) ([]CountResourcesByEnvironmentRow, error)
	CountResourcesInEnvironment(ctx context.Context, environmentID int64) (int64, error)
	CountResourcesInProject(ctx context.Context, projectID int64) (int64, error)
	CountResourcesOnServer(ctx context.Context, serverID int64) (int64, error)
	CountRunningRestoreDrills(ctx context.Context, planID int64) (int64, error)
	CountRunningTaskExecutions(ctx context.Context, scheduledTaskID int64) (int64, error)
	CountServersUsingPrivateKey(ctx context.Context, privateKeyID int64) (int64, error)
	// How many events this rule swallowed since its last send — an aggregated
	// alert must be able to say "and 12 others" rather than hide them (ADR-019).
	CountSuppressedSince(ctx context.Context, arg CountSuppressedSinceParams) (int64, error)
	// Effective admins: a member carrying a custom role is NOT an admin, whatever the
	// fallback role column says. Guards against removing the last admin.
	CountTeamAdmins(ctx context.Context, teamID int64) (int64, error)
	// Queries used by the startup sequence (instance-config §6).
	CountUsers(ctx context.Context) (int64, error)
	// Adoption (§20.7): external_name keeps the original Docker volume name so
	// the normalizing redeployment remounts the SAME data (INV-008).
	CreateAdoptedStorage(ctx context.Context, arg CreateAdoptedStorageParams) (PersistentStorage, error)
	// Adoption scans (PRD §20.7, ADR-013/ADR-023).
	CreateAdoptionScan(ctx context.Context, arg CreateAdoptionScanParams) (AdoptionScan, error)
	// The uuid is generated app-side: it is the envelope-encryption context of
	// token_enc, so a replaced row MUST carry the uuid its ciphertext was bound
	// to — hence uuid = excluded.uuid on conflict.
	CreateAgentToken(ctx context.Context, arg CreateAgentTokenParams) (AgentToken, error)
	// created_by is the human who minted the token, and it is NOT bookkeeping: the
	// middleware intersects a token's permissions with its creator's on every
	// request (rbac-matrix §4.2), so a token without one is a token nothing can
	// narrow when its creator is demoted or leaves. It is also how a CLI token is
	// tied back to the person an access grant was issued to (ADR-045 §5).
	CreateApiToken(ctx context.Context, arg CreateApiTokenParams) (ApiToken, error)
	// ADR-042: application access wall — only the HASH is stored, the cookie
	// value never touches the base (same rule as previews, ADR-030).
	CreateApplicationAccessToken(ctx context.Context, arg CreateApplicationAccessTokenParams) error
	CreateApplicationRow(ctx context.Context, arg CreateApplicationRowParams) error
	CreateBackupExecution(ctx context.Context, arg CreateBackupExecutionParams) (BackupExecution, error)
	// Backups (§7, ADR-014).
	// Target: a managed database OR an internal database of a compose stack
	// (compose-spec §10) — the table CHECK enforces exactly one.
	CreateBackupPlan(ctx context.Context, arg CreateBackupPlanParams) (DatabaseBackupPlan, error)
	CreateBuildConfig(ctx context.Context, arg CreateBuildConfigParams) error
	// CLI login requests (ADR-031, data-dictionary §10.8).
	CreateCliAuthCode(ctx context.Context, arg CreateCliAuthCodeParams) (CliAuthorizationCode, error)
	// Generated domain of a compose component (compose-spec §6): referencing
	// SERVICE_FQDN_<ID> in the file is a declaration of intent — the domain is
	// created from the server wildcard at first deployment.
	CreateComponentDomain(ctx context.Context, arg CreateComponentDomainParams) (Domain, error)
	// Rôles custom d'une team (ADR-038). Composés à partir des permissions
	// granulaires du catalogue ; toujours team-scoped par team_id + uuid.
	CreateCustomRole(ctx context.Context, arg CreateCustomRoleParams) (CustomRole, error)
	// DNS-01 credentials (proxy-contract §7.2). The config is never selected back
	// out to the API: it is decrypted only to be materialized on the server.
	CreateDNSCredential(ctx context.Context, arg CreateDNSCredentialParams) (CloudCredential, error)
	CreateDatabaseCredential(ctx context.Context, arg CreateDatabaseCredentialParams) (DatabaseCredential, error)
	// Managed databases (§6). Passwords are envelope encrypted; connection
	// URLs are rebuilt on the fly, never stored assembled (§6.2).
	CreateDatabaseRow(ctx context.Context, arg CreateDatabaseRowParams) error
	// Deployments (state machine §21.1). Transitions are committed before the
	// next remote action (write-ahead, deployment-engine §4).
	CreateDeployment(ctx context.Context, arg CreateDeploymentParams) (Deployment, error)
	// Rollback artifacts (ADR-006, §10.3).
	CreateDeploymentArtifact(ctx context.Context, arg CreateDeploymentArtifactParams) error
	CreateDeploymentStep(ctx context.Context, arg CreateDeploymentStepParams) (int64, error)
	CreateDestination(ctx context.Context, arg CreateDestinationParams) (Destination, error)
	// Domains (§4.2). Uniqueness (fqdn, path) is enforced by the table.
	CreateDomain(ctx context.Context, arg CreateDomainParams) (Domain, error)
	// GitHub Apps (data-dictionary §7.2, git-webhook-protocols §2) and the
	// discovered-repositories cache (§7.3).
	// Manifest flow step 1: the draft carries the state token (hashed, one-shot)
	// the callback must present. Credentials arrive at conversion.
	CreateDraftGithubApp(ctx context.Context, arg CreateDraftGithubAppParams) (GithubApp, error)
	// The endpoint variant of CreatePortForwardSession: no resource, no preview,
	// and an explicit `authorized_until` — the instant the session is actually cut,
	// which the CLI is told at open and reminded of before it lands.
	CreateEndpointPortForwardSession(ctx context.Context, arg CreateEndpointPortForwardSessionParams) (PortForwardSession, error)
	// Environment variables (§5.4): the production set (is_preview = false)
	// for the v1 endpoints; the preview set lands with previews.
	CreateEnvVar(ctx context.Context, arg CreateEnvVarParams) (EnvironmentVariable, error)
	CreateEnvironment(ctx context.Context, arg CreateEnvironmentParams) (Environment, error)
	// External endpoints and their access grants (ADR-045): declared bastion
	// targets, and the bounded re-authenticated windows during which a user may
	// mint tunnels to them.
	CreateExternalEndpoint(ctx context.Context, arg CreateExternalEndpointParams) (ExternalEndpoint, error)
	// A grant is only ever created behind a fresh second factor; `factor` records
	// which one was consumed, and `renewed_from` chains a renewal to the grant it
	// extended so a long chain stays visible in the audit trail.
	CreateExternalEndpointGrant(ctx context.Context, arg CreateExternalEndpointGrantParams) (ExternalEndpointGrant, error)
	// Magic variables (compose-spec §4.3): written at first use, is_generated,
	// never regenerated while the row exists — the conflict target guarantees it.
	CreateGeneratedEnvVar(ctx context.Context, arg CreateGeneratedEnvVarParams) (int64, error)
	// Generated secret of the PREVIEW variable set (§20.4.4) — e.g. the basic
	// auth credential. Same one-shot semantics as the magic variables.
	CreateGeneratedPreviewEnvVar(ctx context.Context, arg CreateGeneratedPreviewEnvVarParams) (int64, error)
	CreateGeneratedStorage(ctx context.Context, arg CreateGeneratedStorageParams) error
	CreateGitSource(ctx context.Context, arg CreateGitSourceParams) (GitSource, error)
	// One git source per converted app: what applications reference (INV-002).
	CreateGithubAppSource(ctx context.Context, arg CreateGithubAppSourceParams) (GitSource, error)
	CreateIdentity(ctx context.Context, arg CreateIdentityParams) (Identity, error)
	CreateIngressAccessToken(ctx context.Context, arg CreateIngressAccessTokenParams) error
	CreateIngressDomain(ctx context.Context, arg CreateIngressDomainParams) (Domain, error)
	// Ingress endpoints and their attach sessions (ADR-060). The mint/claim
	// discipline mirrors portforwardsessions.sql, but the claim happens agent-side
	// (the control plane only records what the agent reports), so there is no
	// ClaimIngressSession here: the row is stamped from observations.
	CreateIngressEndpoint(ctx context.Context, arg CreateIngressEndpointParams) (IngressEndpoint, error)
	CreateIngressSession(ctx context.Context, arg CreateIngressSessionParams) (IngressTunnelSession, error)
	// Invitations (§10.1). The link token is hashed like any credential; the
	// clear value is returned only once, at creation.
	CreateInvitation(ctx context.Context, arg CreateInvitationParams) (Invitation, error)
	// ON CONFLICT: the operator may already have a server named "localhost" in
	// that team — theirs wins, the seed backs off silently.
	CreateLocalhostServerIfAbsent(ctx context.Context, arg CreateLocalhostServerIfAbsentParams) (int64, error)
	CreateMcpAccessToken(ctx context.Context, arg CreateMcpAccessTokenParams) (McpAccessToken, error)
	// Single-use authorization code, PKCE challenge attached (ADR-043 §3).
	CreateMcpOauthCode(ctx context.Context, arg CreateMcpOauthCodeParams) error
	CreateMfaChallenge(ctx context.Context, arg CreateMfaChallengeParams) error
	// A deployment that rebuilds nothing (ADR-048): the artifact is the one
	// already running, the pipeline reruns to apply the current configuration.
	// `image_digest` pins it when the artifact carries one, so what comes back up
	// is provably the image that was running.
	CreateNoBuildDeployment(ctx context.Context, arg CreateNoBuildDeploymentParams) (Deployment, error)
	CreateNotificationChannel(ctx context.Context, arg CreateNotificationChannelParams) (NotificationChannel, error)
	// ON CONFLICT DO NOTHING: re-reading an outbox event must never notify twice.
	CreateNotificationDelivery(ctx context.Context, arg CreateNotificationDeliveryParams) (NotificationDelivery, error)
	CreateNotificationRule(ctx context.Context, arg CreateNotificationRuleParams) (NotificationRule, error)
	CreateOauthLoginState(ctx context.Context, arg CreateOauthLoginStateParams) error
	CreatePasskeyCeremony(ctx context.Context, arg CreatePasskeyCeremonyParams) error
	// Passkeys (WebAuthn) for the dashboard login.
	CreatePasskeyCredential(ctx context.Context, arg CreatePasskeyCredentialParams) (PasskeyCredential, error)
	CreatePersonalTeam(ctx context.Context, name string) (Team, error)
	// CLI TCP tunnel sessions (ADR-032, data-dictionary §10.7). Mirrors the
	// terminal-session lifecycle.
	CreatePortForwardSession(ctx context.Context, arg CreatePortForwardSessionParams) (PortForwardSession, error)
	// ADR-030: only the HASH is stored — the cookie value never touches the base.
	CreatePreviewAccessToken(ctx context.Context, arg CreatePreviewAccessTokenParams) error
	// SSH private keys (§3.1, §23.2). The uuid is generated by the application
	// so the envelope AAD (table || column || uuid) can bind the ciphertext to
	// its row at insert time (data-dictionary §2.7).
	CreatePrivateKey(ctx context.Context, arg CreatePrivateKeyParams) (PrivateKey, error)
	// Projects and environments (§2, §19.2). All access is scoped by the
	// authenticated team (INV-001); slugs are internal, derived from names.
	CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)
	// Proxy config revisions (§6.2–§6.4).
	CreateProxyRevision(ctx context.Context, arg CreateProxyRevisionParams) (ProxyConfigRevision, error)
	// Private registry credentials (data-dictionary §6.5). The password is never
	// selected back out to the API: only the deployment engine decrypts it, and
	// only to feed the stdin of `docker login` (INV-003).
	CreateRegistryCredential(ctx context.Context, arg CreateRegistryCredentialParams) (RegistryCredential, error)
	// Applications: union base resources + 1-1 extensions (§19.1).
	CreateResource(ctx context.Context, arg CreateResourceParams) (Resource, error)
	// ADR-049: the same hash-only grant for either an application or an inline
	// Compose resource. application_id is also populated for applications during
	// the rolling-upgrade window so an older API replica can validate the grant.
	CreateResourceAccessToken(ctx context.Context, arg CreateResourceAccessTokenParams) error
	CreateRestoreDrill(ctx context.Context, arg CreateRestoreDrillParams) (RestoreDrill, error)
	CreateRollbackDeployment(ctx context.Context, arg CreateRollbackDeploymentParams) (Deployment, error)
	CreateRuntimeConfig(ctx context.Context, arg CreateRuntimeConfigParams) error
	CreateS3Storage(ctx context.Context, arg CreateS3StorageParams) (S3Storage, error)
	// Scheduled tasks (§192). The scheduler owns next_run_at, exactly like the
	// backup plans: the cron expression alone cannot tell whether an occurrence
	// has already fired.
	CreateScheduledTask(ctx context.Context, arg CreateScheduledTaskParams) (ScheduledTask, error)
	// SCIM 2.0 provisioning (ADR-038 bis). A SCIM token is scoped to one team; the
	// endpoints authenticate with it and act only within that team.
	CreateScimToken(ctx context.Context, arg CreateScimTokenParams) (ScimToken, error)
	// Servers (§3, state machine §21.2).
	CreateServer(ctx context.Context, arg CreateServerParams) (Server, error)
	// Compose stacks and their components (compose-spec.md, data-dictionary §9).
	CreateServiceRow(ctx context.Context, arg CreateServiceRowParams) error
	CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
	// Shared variables (§5.4, §3.1).
	CreateSharedVariable(ctx context.Context, arg CreateSharedVariableParams) (SharedVariable, error)
	// Persistent storages (§8).
	CreateStorage(ctx context.Context, arg CreateStorageParams) (PersistentStorage, error)
	CreateTaskExecution(ctx context.Context, arg CreateTaskExecutionParams) (TaskExecution, error)
	// A team created by the instance root (ADR-038): not personal — it exists to
	// be shared, unlike the bootstrap team of a user.
	CreateTeam(ctx context.Context, arg CreateTeamParams) (Team, error)
	// Web terminal sessions (PRD §5.7/§24.4, ADR-024, data-dictionary §10.6).
	CreateTerminalSession(ctx context.Context, arg CreateTerminalSessionParams) (TerminalSession, error)
	// Uptime monitoring (ADR-017).
	CreateUptimeCheck(ctx context.Context, arg CreateUptimeCheckParams) (UptimeCheck, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
	// ON CONFLICT DO NOTHING: a redelivery keeps the provider's delivery id, so the
	// unique constraint absorbs it — no second row, no second deployment.
	CreateWebhookDelivery(ctx context.Context, arg CreateWebhookDeliveryParams) (WebhookDelivery, error)
	// Incoming Git webhooks (§20.3, INV-009).
	CreateWebhookEndpoint(ctx context.Context, arg CreateWebhookEndpointParams) (WebhookEndpoint, error)
	// The compose components' domains (compose-spec §6). Deleted with the
	// application: the (fqdn, path) uniqueness is GLOBAL and hard (INV-002) — a
	// surviving row locks the URL against any future application, forever.
	DeleteComponentDomainsForResource(ctx context.Context, resourceID int64) error
	DeleteCustomRole(ctx context.Context, arg DeleteCustomRoleParams) (int64, error)
	// The image it referenced has been reclaimed: drop the now-dangling rollback
	// pointer so it is never offered as a target.
	DeleteDeploymentArtifact(ctx context.Context, id int64) error
	DeleteDomainsForApplication(ctx context.Context, applicationID *int64) error
	DeleteEnvVar(ctx context.Context, id int64) (int64, error)
	DeleteEnvVarsNotInKeys(ctx context.Context, arg DeleteEnvVarsNotInKeysParams) error
	DeleteExpiredMcpOauthCodes(ctx context.Context) error
	DeleteExpiredPreviewAccessTokens(ctx context.Context) error
	DeleteExternalEndpoint(ctx context.Context, arg DeleteExternalEndpointParams) (int64, error)
	// The compose-mirrored rows (§2.4): rewritten wholesale at each deployment —
	// the FILE is the source of truth, these rows only make it visible.
	DeleteGeneratedStoragesForResource(ctx context.Context, resourceID int64) error
	DeleteGithubApp(ctx context.Context, id int64) (int64, error)
	// Scoped by user: a session must never unlink someone else's identity.
	DeleteIdentityForUser(ctx context.Context, arg DeleteIdentityForUserParams) (int64, error)
	DeleteIngressEndpoint(ctx context.Context, arg DeleteIngressEndpointParams) (IngressEndpoint, error)
	DeleteMfaFactorForUser(ctx context.Context, userID int64) (int64, error)
	DeleteNotificationChannel(ctx context.Context, id int64) (int64, error)
	DeleteNotificationRule(ctx context.Context, id int64) (int64, error)
	DeleteOauthProviderConfig(ctx context.Context, provider OauthProvider) (int64, error)
	// Scoped by user: a session must never be able to delete someone else's key.
	DeletePasskeyForUser(ctx context.Context, arg DeletePasskeyForUserParams) (int64, error)
	DeletePrivateKey(ctx context.Context, id int64) (int64, error)
	DeleteS3Storage(ctx context.Context, id int64) (int64, error)
	DeleteSharedVariable(ctx context.Context, id int64) (int64, error)
	DeleteStorage(ctx context.Context, id int64) (int64, error)
	DeleteVanishedRepositories(ctx context.Context, arg DeleteVanishedRepositoriesParams) (int64, error)
	// A service removed from the compose file loses its component row — and with
	// it, by CASCADE, its domains and backup plans (explicit in the API response).
	DeleteVanishedServiceComponents(ctx context.Context, arg DeleteVanishedServiceComponentsParams) (int64, error)
	DeleteWebhookEndpoint(ctx context.Context, id int64) (int64, error)
	DequeueJob(ctx context.Context, arg DequeueJobParams) (Job, error)
	// [{"tbl","col","key_version","row_count"}, ...] over the WHOLE inventory. A
	// rotation has converged once the active version is the only one left -- a claim
	// that only holds because the inventory is exhaustive by construction.
	EncryptionKeyVersionHistogram(ctx context.Context) ([]byte, error)
	// Writes back one re-encrypted value, ciphertext only; returns rows written.
	EncryptionRotationApply(ctx context.Context, arg EncryptionRotationApplyParams) (int64, error)
	// One batch of rows still on another key version, with the row identity bound
	// into their AAD so the caller can decrypt and re-encrypt them.
	EncryptionRotationCandidates(ctx context.Context, arg EncryptionRotationCandidatesParams) ([]byte, error)
	EndIngressSession(ctx context.Context, arg EndIngressSessionParams) (int64, error)
	EndIngressSessionByUUID(ctx context.Context, arg EndIngressSessionByUUIDParams) (IngressTunnelSession, error)
	// The optional generation is ADR-065 §5: an attach finalizes the session only
	// while it is still THE attach, so a socket that lost a re-claim cannot close
	// the row its successor is using. Revocation, the operator's close and the
	// sweep pass NULL, because their verdict is about the session and not about
	// whichever socket happens to hold it.
	EndPortForwardSession(ctx context.Context, arg EndPortForwardSessionParams) (int64, error)
	// Idempotent: only the first close wins, so end_reason keeps the true cause
	// when the WS teardown and a timeout race each other.
	//
	// attach_seq is the optional generation guard of ADR-065 §5: an attach
	// finalizes the session only while it is still THE attach, so a displaced one
	// updates zero rows and the row stays open for the winner. Revocation, the
	// operator cut and the sweep pass no generation and finalize unconditionally —
	// their verdict is about the session, not about whichever socket holds it.
	EndTerminalSession(ctx context.Context, arg EndTerminalSessionParams) (int64, error)
	// Durable job queue (ADR-002, §21.3). Dequeue uses FOR UPDATE SKIP LOCKED
	// on the partial index of eligible jobs; lock_key exclusivity is enforced
	// both here (NOT EXISTS) and by the partial unique index as the net.
	EnqueueJob(ctx context.Context, arg EnqueueJobParams) (Job, error)
	// Renewal pushes back an existing window in place. Guarded on the row still
	// being live: a grant that expired between the ceremony and this statement is
	// not renewable, it is a new request (ADR-045 §5).
	ExtendExternalEndpointGrant(ctx context.Context, arg ExtendExternalEndpointGrantParams) (ExternalEndpointGrant, error)
	FailAdoptionScan(ctx context.Context, arg FailAdoptionScanParams) error
	FailJob(ctx context.Context, arg FailJobParams) (int64, error)
	FinishBackupExecution(ctx context.Context, arg FinishBackupExecutionParams) error
	FinishDeploymentStep(ctx context.Context, arg FinishDeploymentStepParams) error
	FinishNotificationDelivery(ctx context.Context, arg FinishNotificationDeliveryParams) error
	FinishRestoreDrill(ctx context.Context, arg FinishRestoreDrillParams) error
	FinishTaskExecution(ctx context.Context, arg FinishTaskExecutionParams) error
	FinishWebhookDelivery(ctx context.Context, arg FinishWebhookDeliveryParams) error
	ForgetDeadLetterJob(ctx context.Context, id int64) (int64, error)
	// Bearer token authentication (§10.3, ERD §12: prefix pre-filter then
	// constant-time hash comparison in the application).
	GetActiveApiTokensByPrefix(ctx context.Context, tokenPrefix string) ([]GetActiveApiTokensByPrefixRow, error)
	GetAdoptionScanByID(ctx context.Context, id int64) (AdoptionScan, error)
	GetAdoptionScanByUUIDForTeam(ctx context.Context, arg GetAdoptionScanByUUIDForTeamParams) (GetAdoptionScanByUUIDForTeamRow, error)
	GetAgentTokenByHash(ctx context.Context, tokenHash string) (AgentToken, error)
	// Per-server agent tokens (ADR-040): observations-only credentials for the
	// server helper. One row per server; the plaintext survives encrypted so the
	// idempotent provisioning re-injects the same token at every ensure pass.
	GetAgentTokenByServerID(ctx context.Context, serverID int64) (AgentToken, error)
	// The application behind a forward-auth call (identity carried in the
	// middleware address, ADR-030's lesson about rewritten X-Forwarded-Host).
	GetApplicationAccessByUUID(ctx context.Context, uuid pgtype.UUID) (GetApplicationAccessByUUIDRow, error)
	GetApplicationByID(ctx context.Context, id int64) (GetApplicationByIDRow, error)
	// Resolves a browser Host to the application that serves it (ADR-042): an
	// application-level domain or a compose component's own domain.
	GetApplicationByRoutedHost(ctx context.Context, host string) (GetApplicationByRoutedHostRow, error)
	GetApplicationByUUID(ctx context.Context, arg GetApplicationByUUIDParams) (GetApplicationByUUIDRow, error)
	GetArtifactByDigest(ctx context.Context, arg GetArtifactByDigestParams) (DeploymentArtifact, error)
	GetArtifactForDeployment(ctx context.Context, arg GetArtifactForDeploymentParams) (DeploymentArtifact, error)
	GetBackupExecutionByID(ctx context.Context, id int64) (BackupExecution, error)
	GetBackupExecutionByUUID(ctx context.Context, arg GetBackupExecutionByUUIDParams) (BackupExecution, error)
	GetBackupPlanByID(ctx context.Context, id int64) (DatabaseBackupPlan, error)
	GetBackupPlanByUUID(ctx context.Context, arg GetBackupPlanByUUIDParams) (DatabaseBackupPlan, error)
	GetBackupPlanByUUIDForComponent(ctx context.Context, arg GetBackupPlanByUUIDForComponentParams) (DatabaseBackupPlan, error)
	GetCertificateByID(ctx context.Context, id int64) (Certificate, error)
	GetCertificateByUUIDForTeam(ctx context.Context, arg GetCertificateByUUIDForTeamParams) (GetCertificateByUUIDForTeamRow, error)
	GetCliAuthCodeByRequestHash(ctx context.Context, requestIDHash string) (CliAuthorizationCode, error)
	// Everything the backup job needs about a component plan's target: the
	// component, its stack resource (container names derive from its uuid) and
	// the server behind the stack's destination.
	GetComponentBackupTarget(ctx context.Context, id int64) (GetComponentBackupTargetRow, error)
	// The artifact currently serving traffic: the one of the last succeeded
	// deployment. This is what a skip_build deployment redeploys (ADR-048) —
	// same image, fresh configuration.
	GetCurrentArtifact(ctx context.Context, resourceID int64) (DeploymentArtifact, error)
	// Same, scoped to one PR instance: a preview never redeploys the production
	// image (INV-010/INV-011).
	GetCurrentPreviewArtifact(ctx context.Context, previewID *int64) (DeploymentArtifact, error)
	// Read path of a simulated custom role (ADR-058): the session stores the id, and
	// resolving it back to permissions happens on every authenticated request while
	// the mode is on. The team is checked by the caller against the session's team.
	GetCustomRoleByID(ctx context.Context, id int64) (CustomRole, error)
	GetCustomRoleByUUID(ctx context.Context, arg GetCustomRoleByUUIDParams) (CustomRole, error)
	GetDNSCredentialByID(ctx context.Context, id int64) (CloudCredential, error)
	GetDNSCredentialByUUID(ctx context.Context, arg GetDNSCredentialByUUIDParams) (CloudCredential, error)
	GetDatabaseByID(ctx context.Context, id int64) (GetDatabaseByIDRow, error)
	GetDatabaseByUUID(ctx context.Context, arg GetDatabaseByUUIDParams) (GetDatabaseByUUIDRow, error)
	GetDefaultDestination(ctx context.Context, serverID int64) (Destination, error)
	// Git sources (§5.1, data-dictionary §7.1).
	// One source per (team, deploy key): the API references keys, not sources, so
	// reusing the same key for several applications must not multiply the rows.
	GetDeployKeySource(ctx context.Context, arg GetDeployKeySourceParams) (GitSource, error)
	GetDeploymentByID(ctx context.Context, id int64) (Deployment, error)
	// The git repository URL and provider ride along (git source only) so the UI can
	// link the branch, commit and PR back to the forge.
	GetDeploymentByUUIDForTeam(ctx context.Context, arg GetDeploymentByUUIDForTeamParams) (GetDeploymentByUUIDForTeamRow, error)
	GetDeploymentStatus(ctx context.Context, deploymentID int64) (DeploymentStatus, error)
	GetDestinationByID(ctx context.Context, id int64) (Destination, error)
	GetEnvVarByKey(ctx context.Context, arg GetEnvVarByKeyParams) (EnvironmentVariable, error)
	GetEnvVarByUUID(ctx context.Context, arg GetEnvVarByUUIDParams) (EnvironmentVariable, error)
	GetEnvironmentByID(ctx context.Context, id int64) (Environment, error)
	GetEnvironmentByUUID(ctx context.Context, arg GetEnvironmentByUUIDParams) (Environment, error)
	// Adoption targets an environment across projects: team isolation only
	// (INV-002).
	GetEnvironmentByUUIDForTeam(ctx context.Context, arg GetEnvironmentByUUIDForTeamParams) (Environment, error)
	GetExternalEndpointByID(ctx context.Context, id int64) (ExternalEndpoint, error)
	GetExternalEndpointByUUID(ctx context.Context, arg GetExternalEndpointByUUIDParams) (ExternalEndpoint, error)
	GetExternalEndpointGrantByUUID(ctx context.Context, uuid pgtype.UUID) (ExternalEndpointGrant, error)
	GetGitSourceByID(ctx context.Context, id int64) (GitSource, error)
	GetGitSourceForGithubApp(ctx context.Context, githubAppID *int64) (GitSource, error)
	// Webhook routing: X-GitHub-Hook-Installation-Target-ID names the app_id
	// (§2.5) — instance-wide, the signature then proves the sender.
	GetGithubAppByAppID(ctx context.Context, appID *int64) (GithubApp, error)
	GetGithubAppByID(ctx context.Context, id int64) (GithubApp, error)
	// Callback resolution: the state is single-use and expiring — matched hashed,
	// never logged (INV-003).
	GetGithubAppByStateHash(ctx context.Context, manifestStateHash *string) (GithubApp, error)
	GetGithubAppByUUID(ctx context.Context, arg GetGithubAppByUUIDParams) (GithubApp, error)
	// Browser callbacks (manifest redirect, setup) carry no team context: the
	// uuid alone resolves the app; the state/signature proves the caller.
	GetGithubAppByUUIDAny(ctx context.Context, uuid pgtype.UUID) (GithubApp, error)
	GetHealthCheck(ctx context.Context, resourceID int64) (HealthCheck, error)
	GetIdentity(ctx context.Context, arg GetIdentityParams) (Identity, error)
	// The authorize step resolves the redirect host to a declared endpoint — the
	// sole anti-open-redirect rule, same as GetResourceByRoutedHost.
	GetIngressEndpointByFQDN(ctx context.Context, fqdn string) (IngressEndpoint, error)
	GetIngressEndpointByID(ctx context.Context, id int64) (IngressEndpoint, error)
	GetIngressEndpointByUUID(ctx context.Context, arg GetIngressEndpointByUUIDParams) (IngressEndpoint, error)
	// Unscoped by design: the SSO wall's forward-auth is called by Traefik, which
	// has no team — the reference travels in the middleware address (ADR-030).
	GetIngressEndpointByUUIDGlobal(ctx context.Context, uuid pgtype.UUID) (IngressEndpoint, error)
	GetInstancePrivateKey(ctx context.Context) (PrivateKey, error)
	GetInstanceSettings(ctx context.Context) (InstanceSetting, error)
	GetJobByIdempotencyKey(ctx context.Context, idempotencyKey *string) (Job, error)
	GetJobByUUIDForTeam(ctx context.Context, arg GetJobByUUIDForTeamParams) (Job, error)
	GetJobUUIDByID(ctx context.Context, id int64) (pgtype.UUID, error)
	GetLastAppliedProxyRevision(ctx context.Context, arg GetLastAppliedProxyRevisionParams) (ProxyConfigRevision, error)
	// What the application currently runs. A skip_build deployment (ADR-048)
	// inherits its commit: it applies a configuration, never a new commit.
	GetLastSucceededDeployment(ctx context.Context, resourceID int64) (Deployment, error)
	// Same, for one PR instance — pinned to the head SHA that instance runs.
	GetLastSucceededPreviewDeployment(ctx context.Context, previewID *int64) (Deployment, error)
	GetLatestSuccessfulBackupExecution(ctx context.Context, backupPlanID int64) (BackupExecution, error)
	// The hot path on every mint: the caller's own live grant on this endpoint.
	// Revoked and expired rows are invisible here, which is what makes revocation
	// and expiry take effect without a sweep.
	GetLiveExternalEndpointGrant(ctx context.Context, arg GetLiveExternalEndpointGrantParams) (ExternalEndpointGrant, error)
	// A grant is valid only while its human still exists, still belongs to the
	// granted team and that team still exists. Role/custom-role permissions ride
	// with the row so every MCP request is authorized against CURRENT authority:
	// removing or demoting a member converges immediately without a separate token
	// revocation pass.
	GetMcpAccessTokenByHash(ctx context.Context, tokenHash string) (GetMcpAccessTokenByHashRow, error)
	GetMcpOauthClient(ctx context.Context, clientID string) (McpOauthClient, error)
	// Read without consuming: a mistyped code must not send the user back to the
	// password form — the account lockout is what bounds the guesses.
	GetMfaChallenge(ctx context.Context, tokenHash string) (MfaChallenge, error)
	// 2FA TOTP (PRD §10.2, §23.3): one factor per user, envelope-encrypted
	// secret, hashed recovery codes, and the short-lived login challenges of a
	// two-step login.
	GetMfaFactorForUser(ctx context.Context, userID int64) (MfaFactor, error)
	GetNotificationChannelByID(ctx context.Context, id int64) (NotificationChannel, error)
	GetNotificationChannelByUUID(ctx context.Context, arg GetNotificationChannelByUUIDParams) (NotificationChannel, error)
	GetNotificationCursor(ctx context.Context) (int64, error)
	GetNotificationRuleByUUID(ctx context.Context, arg GetNotificationRuleByUUIDParams) (NotificationRule, error)
	GetOauthProviderConfig(ctx context.Context, provider OauthProvider) (OauthProviderConfig, error)
	// The localhost server lands in the first team of the instance — the root
	// user's, by construction (§6.2).
	GetOldestTeamID(ctx context.Context) (int64, error)
	GetOpenIngressSessionByUUID(ctx context.Context, uuid pgtype.UUID) (IngressTunnelSession, error)
	// The occupancy probe (ADR-060 §6): the partial unique index makes at most one
	// row match. "Open" means not ended — an unclaimed, unexpired mint occupies.
	GetOpenIngressSessionForEndpoint(ctx context.Context, endpointID *int64) (GetOpenIngressSessionForEndpointRow, error)
	// The login ceremony starts from the credential: the authenticator presents a
	// credential id, and the user is whoever enrolled it. A deleted user's
	// passkeys must not open sessions, hence the join.
	GetPasskeyByCredentialID(ctx context.Context, credentialID []byte) (GetPasskeyByCredentialIDRow, error)
	// Reads a still-pending invitation WITHOUT claiming it, so the landing page of
	// an invitation link can say which team and which address it is for before
	// asking the invitee to create their account. Same pending guard as the claim:
	// an accepted, revoked or expired link resolves to nothing at all.
	//
	// Returning the email is not an enumeration risk: the link token is a secret
	// issued to that address, so holding it already proves possession of the
	// invitation. Nothing here is reachable without it.
	GetPendingInvitationByTokenHash(ctx context.Context, tokenHash string) (GetPendingInvitationByTokenHashRow, error)
	GetPortForwardSessionByUUID(ctx context.Context, arg GetPortForwardSessionByUUIDParams) (PortForwardSession, error)
	// The terminal's twin (GetTerminalSessionEndReason), and for the same one
	// caller: the beat above matched zero rows, so the reason this session ended
	// with was written by somebody else — the sweep, a revocation, a grant that
	// expired, a target that stopped — and it is on the row. Reading it is what
	// keeps a cross-replica close from reaching the developer as `disconnect`.
	//
	// Read at most once per session, on the beat that discovers the row is gone,
	// which is why the liveness statement above is left alone: paying for this on
	// every beat would buy nothing.
	//
	// NULL means the row is still open — the supersession case of ADR-065 §5, not a
	// finalized session — and the caller treats it as the `disconnect` fallback.
	GetPortForwardSessionEndReason(ctx context.Context, id int64) (*TerminalEndReason, error)
	GetPreviewAccessTokenByHash(ctx context.Context, tokenHash string) (PreviewAccessToken, error)
	// Resolves the browser's Host to a preview (ADR-030): the preview's own fqdn,
	// or a compose service's derived `<service>-<fqdn>` (§20.4.1).
	GetPreviewByHost(ctx context.Context, host string) (Preview, error)
	GetPreviewByID(ctx context.Context, id int64) (Preview, error)
	GetPreviewByIdentity(ctx context.Context, arg GetPreviewByIdentityParams) (Preview, error)
	GetPreviewByUUID(ctx context.Context, uuid pgtype.UUID) (Preview, error)
	// Team ownership travels through the application chain (INV-002).
	GetPreviewByUUIDForTeam(ctx context.Context, arg GetPreviewByUUIDForTeamParams) (Preview, error)
	// The most recent artifact of a successful deployment other than the one
	// currently serving traffic (the last succeeded deployment).
	GetPreviousArtifact(ctx context.Context, resourceID int64) (DeploymentArtifact, error)
	GetPrivateKeyByID(ctx context.Context, id int64) (PrivateKey, error)
	GetPrivateKeyByUUID(ctx context.Context, arg GetPrivateKeyByUUIDParams) (PrivateKey, error)
	GetProjectByID(ctx context.Context, id int64) (Project, error)
	GetProjectByUUID(ctx context.Context, arg GetProjectByUUIDParams) (Project, error)
	GetRegistryCredentialByID(ctx context.Context, id int64) (RegistryCredential, error)
	GetRegistryCredentialByUUID(ctx context.Context, arg GetRegistryCredentialByUUIDParams) (RegistryCredential, error)
	// Exact match, never a prefix comparison (§23.5): webhook → resource.
	GetRepositoryByFullName(ctx context.Context, arg GetRepositoryByFullNameParams) (Repository, error)
	GetRepositoryByID(ctx context.Context, id int64) (Repository, error)
	// ADR-049: access protection is shared by application and inline Compose
	// resources. The identity is carried in the forwardAuth address.
	GetResourceAccessByUUID(ctx context.Context, uuid pgtype.UUID) (GetResourceAccessByUUIDRow, error)
	GetResourceByID(ctx context.Context, id int64) (Resource, error)
	// Resolves the most specific application-level or per-component domain for
	// the SSO callback's anti-open-redirect check. Host alone is insufficient:
	// separate resources may legitimately own different paths of the same FQDN.
	GetResourceByRoutedHost(ctx context.Context, arg GetResourceByRoutedHostParams) (GetResourceByRoutedHostRow, error)
	// The optional resource link of a check (INV-002 isolation).
	GetResourceByUUIDForTeam(ctx context.Context, arg GetResourceByUUIDForTeamParams) (Resource, error)
	GetResourceRemnants(ctx context.Context, id int64) ([]byte, error)
	GetS3StorageByID(ctx context.Context, id int64) (S3Storage, error)
	GetS3StorageByUUID(ctx context.Context, arg GetS3StorageByUUIDParams) (S3Storage, error)
	GetScheduledTaskByID(ctx context.Context, id int64) (GetScheduledTaskByIDRow, error)
	GetScheduledTaskByUUID(ctx context.Context, arg GetScheduledTaskByUUIDParams) (GetScheduledTaskByUUIDRow, error)
	// A team member by user UUID (the SCIM resource id), with the internal user id
	// needed to revoke sessions on deprovision.
	GetScimMember(ctx context.Context, arg GetScimMemberParams) (GetScimMemberRow, error)
	// Resolves a bearer SCIM token to its team; unrevoked only.
	GetScimTokenByHash(ctx context.Context, tokenHash string) (GetScimTokenByHashRow, error)
	GetServerByID(ctx context.Context, id int64) (Server, error)
	GetServerByUUID(ctx context.Context, arg GetServerByUUIDParams) (Server, error)
	GetServiceByID(ctx context.Context, id int64) (Service, error)
	GetServiceComponentByUUID(ctx context.Context, arg GetServiceComponentByUUIDParams) (ServiceComponent, error)
	// Full stack lookup (mirror of GetApplicationByUUID): the resource, the
	// compose extension, and the placement identities the API renders.
	GetServiceStackByUUID(ctx context.Context, arg GetServiceStackByUUIDParams) (GetServiceStackByUUIDRow, error)
	// A session is only valid while it is unrevoked AND unexpired: both are checked
	// in SQL so no caller can forget one of them.
	GetSessionByTokenHash(ctx context.Context, tokenHash string) (GetSessionByTokenHashRow, error)
	GetSharedVariableByUUID(ctx context.Context, arg GetSharedVariableByUUIDParams) (SharedVariable, error)
	// Agent ingestion ownership check (ADR-040): resolve a SLEEPING preview by
	// uuid only when it lives on the given server — an agent token can never
	// touch another server's state.
	GetSleepingPreviewForServer(ctx context.Context, arg GetSleepingPreviewForServerParams) (Preview, error)
	GetStorageByUUID(ctx context.Context, arg GetStorageByUUIDParams) (PersistentStorage, error)
	// Teams (§10.1). Cursor pagination follows ERD §12: (team_id, id DESC)
	// ordering, opaque cursor carrying the last seen internal id.
	GetTeamByID(ctx context.Context, id int64) (Team, error)
	GetTeamByUUID(ctx context.Context, uuid pgtype.UUID) (Team, error)
	// Idempotent match for a SCIM-provisioned member (the IdP's externalId).
	GetTeamMemberByExternalID(ctx context.Context, arg GetTeamMemberByExternalIDParams) (GetTeamMemberByExternalIDRow, error)
	// Member role management (ADR-038).
	GetTeamMemberByUUID(ctx context.Context, arg GetTeamMemberByUUIDParams) (GetTeamMemberByUUIDRow, error)
	// The team a session acts in, with its role and public UUID (the dashboard
	// addresses team endpoints by UUID). Falls back to the personal team.
	// Carries the user's instance-root flag (users.is_root) so the session identity
	// can gate instance-wide settings (rbac-matrix §3.5).
	// A custom role (custom_role_id), when set, OVERRIDES the system role: its
	// granular permissions are carried back for the session identity (ADR-038).
	//
	// `preferred_team_id` is the team the session asked to act in (its
	// current_team_id, or the user's remembered last_team_id at login). It is a
	// PREFERENCE, not a filter: the row comes back only if the user really holds a
	// membership in that team, so a session pinned to a team the user was removed
	// from silently falls back to their oldest one instead of keeping an access
	// nobody granted any more (INV-001). Pass 0 for "no preference".
	//
	// Soft-deleted teams are excluded: a deleted team must stop being a place one
	// can act in, whatever a stale session row still points at.
	GetTeamMembershipForUser(ctx context.Context, arg GetTeamMembershipForUserParams) (GetTeamMembershipForUserRow, error)
	// The second half of the beat above, and the ONLY caller: read once, when the
	// heartbeat matched zero rows, so the socket can report the word its session
	// actually ended with instead of guessing one. It is never on the beat's common
	// path — a session reaches this statement at most once, on the beat that
	// discovers it is over — which is why the liveness update stays a single
	// statement rather than growing a RETURNING and a join for the case that
	// happens once.
	//
	// NULL is a real answer and not an error: the row is still open, which is the
	// generation case (another attach superseded this one) rather than the
	// finalized one. The caller falls back to `disconnect` there, deliberately.
	GetTerminalSessionEndReason(ctx context.Context, id int64) (*TerminalEndReason, error)
	// What a token's creator holds in the token's team, re-read on every request
	// (rbac-matrix §4.2). A token never grants more than its creator, so this is
	// the ceiling its own scopes are intersected with — and it is why a demoted
	// creator narrows their tokens without anyone revoking anything.
	//
	// No row means the creator is no longer a member of that team: the token then
	// holds nothing, which is the convergence the rule exists for.
	GetTokenCreatorAuthority(ctx context.Context, arg GetTokenCreatorAuthorityParams) (GetTokenCreatorAuthorityRow, error)
	GetUptimeCheckByUUID(ctx context.Context, arg GetUptimeCheckByUUIDParams) (UptimeCheck, error)
	// Browser sessions (PRD §698).
	GetUserByEmail(ctx context.Context, email string) (User, error)
	// The collision check of §23.3 must also see soft-deleted accounts: a
	// tombstoned email must not be resurrectable by whoever registers it at an
	// identity provider.
	GetUserByEmailIncludingDeleted(ctx context.Context, email string) (User, error)
	GetUserByID(ctx context.Context, id int64) (User, error)
	GetWebhookDeliveryByID(ctx context.Context, id int64) (WebhookDelivery, error)
	// Resolution at reception: the endpoint carries everything needed to verify
	// the signature and route the delivery.
	GetWebhookEndpointByUUID(ctx context.Context, uuid pgtype.UUID) (GetWebhookEndpointByUUIDRow, error)
	GetWebhookEndpointForApplication(ctx context.Context, arg GetWebhookEndpointForApplicationParams) (WebhookEndpoint, error)
	HeartbeatJob(ctx context.Context, arg HeartbeatJobParams) (int64, error)
	// The WebSocket already pings every 20 s. Persisting one successful beat lets
	// another replica, or the process that starts after a crash, reject a ghost.
	//
	// Generation-aware since ADR-065 §5: the bridge already ends itself when this
	// updates zero rows — "another replica or the scheduler finalized this" — and
	// "another attach superseded me" is the same sentence. It is how supersession
	// converges across replicas, within one beat, with no new mechanism.
	HeartbeatPortForwardSession(ctx context.Context, arg HeartbeatPortForwardSessionParams) (int64, error)
	// The bridge already pings its peer every 20 s. Persisting one successful beat
	// is what lets another replica, or the process that starts after a crash, tell
	// a live shell from a ghost — and it is the statement ADR-067 §1 hangs the
	// target's activity signal off, because a beat is the only moment an attached
	// session talks to the control plane while a developer sits and reads.
	//
	// Generation-aware exactly like the tunnel's (ADR-065 §5): zero rows updated is
	// one sentence with three causes — the scheduler or another replica finalized
	// this row, or another attach superseded this one — and one conclusion, that
	// the socket must not outlive its own durable authorization.
	HeartbeatTerminalSession(ctx context.Context, arg HeartbeatTerminalSessionParams) (int64, error)
	// Audit log (§23.4): strictly append-only — no UPDATE or single DELETE
	// query must ever exist against this table.
	InsertAuditEvent(ctx context.Context, arg InsertAuditEventParams) error
	InsertInstanceSettingsIfAbsent(ctx context.Context, arg InsertInstanceSettingsIfAbsentParams) (int64, error)
	InsertOutboxEvent(ctx context.Context, arg InsertOutboxEventParams) error
	IsJobCancelRequested(ctx context.Context, id int64) (bool, error)
	// /keep or the UI button: reset the inactivity clock and clear any pending
	// expiry warning — the developer still needs this preview.
	KeepPreviewAlive(ctx context.Context, id int64) error
	LastSentDelivery(ctx context.Context, ruleID int64) (pgtype.Timestamptz, error)
	ListAdoptionScansForServer(ctx context.Context, arg ListAdoptionScansForServerParams) ([]AdoptionScan, error)
	// API token management (§10.3). Token values are never stored nor
	// returned: only the SHA-256 hash and the identification prefix.
	// Two readings of the same list, told apart by created_by: the personal one
	// ("my tokens", the caller's own) and the team-wide one an admin needs to see
	// what exists. NULL means no filter — the team reading; a value means only
	// that person's. The owner's email rides along so the team reading can say
	// WHOSE a token is, which is the only thing that makes it actionable.
	ListApiTokensPage(ctx context.Context, arg ListApiTokensPageParams) ([]ListApiTokensPageRow, error)
	// Every local rollback image of the application (non-preview deployments) on
	// one server, newest first — the caller keeps the N most recent and reclaims
	// the rest (ADR-006 retention, §29.4). The live image is the newest here, so a
	// retention >= 1 always protects it.
	ListAppArtifactsOnServer(ctx context.Context, arg ListAppArtifactsOnServerParams) ([]ListAppArtifactsOnServerRow, error)
	// Fan-out of an app-level push webhook (protocols §2.4): every application
	// bound to the pushed repository, matched by the provider-side repo ID —
	// exact identity, never a URL comparison (INV-009, §23.5).
	ListApplicationIDsForRepositoryPush(ctx context.Context, arg ListApplicationIDsForRepositoryPushParams) ([]int64, error)
	ListApplicationsByTags(ctx context.Context, arg ListApplicationsByTagsParams) ([]pgtype.UUID, error)
	ListApplicationsPage(ctx context.Context, arg ListApplicationsPageParams) ([]ListApplicationsPageRow, error)
	// Awake applications that opted into scale-to-zero and are meant to run: the
	// scheduler reads each one's waker activity file over SSH and sleeps the ones
	// idle past their window (ADR-037). A manually stopped app (desired_status !=
	// running) is never touched.
	// last_activity_at comes along for the same reason previews carry theirs: a
	// signal the waker cannot produce (an attached port-forward) has to reach the
	// sleep decision, and updated_at only moves on a deploy or a config change.
	ListApplicationsToSleep(ctx context.Context) ([]ListApplicationsToSleepRow, error)
	// The current expected state of each scope on a server: its last applied
	// revision (drift reconciliation, §6.2.4).
	ListAppliedProxyRevisions(ctx context.Context, serverID int64) ([]ProxyConfigRevision, error)
	// Read side of the audit trail (§23.4: paginé, filtrable, exportable). A SELECT
	// does not violate the append-only rule. Team-scoped; optional filters on action,
	// result, actor, target and an occurred_at window; cursor by descending id.
	ListAuditEventsPage(ctx context.Context, arg ListAuditEventsPageParams) ([]AuditEvent, error)
	ListBackupExecutionsPage(ctx context.Context, arg ListBackupExecutionsPageParams) ([]BackupExecution, error)
	ListBackupPlansForComponent(ctx context.Context, serviceComponentID *int64) ([]DatabaseBackupPlan, error)
	ListBackupPlansForDatabase(ctx context.Context, databaseID *int64) ([]DatabaseBackupPlan, error)
	// The build phases only: switching/finishing are past the point of no
	// return, and terminal states have nothing to cancel.
	ListCancellablePreviewDeploymentIDs(ctx context.Context, arg ListCancellablePreviewDeploymentIDsParams) ([]int64, error)
	ListCertificatesForServer(ctx context.Context, arg ListCertificatesForServerParams) ([]Certificate, error)
	// Certificates entering a threshold they have not been announced for yet
	// (§4.3). A certificate already alerted at J-30 stays silent until it crosses
	// J-7 — the alert fires on the transition, not on every pass.
	ListCertificatesToAlert(ctx context.Context, thresholdDays int32) ([]ListCertificatesToAlertRow, error)
	// Cleanup-enabled, ready servers (§3.7). The scheduler owns the cron window
	// (cleanup_next_run_at) exactly like the backup plans.
	ListCleanupSchedulableServers(ctx context.Context) ([]Server, error)
	ListCustomRolesPage(ctx context.Context, arg ListCustomRolesPageParams) ([]CustomRole, error)
	ListDNSCredentialsPage(ctx context.Context, arg ListDNSCredentialsPageParams) ([]CloudCredential, error)
	ListDatabasesPage(ctx context.Context, arg ListDatabasesPageParams) ([]ListDatabasesPageRow, error)
	ListDeploymentSteps(ctx context.Context, deploymentID int64) ([]DeploymentStep, error)
	// The preview's PR number (NULL for a production deployment) rides along so the
	// UI can say "preview #N" instead of a bare "preview".
	ListDeploymentsForResource(ctx context.Context, arg ListDeploymentsForResourceParams) ([]ListDeploymentsForResourceRow, error)
	// --- deferred digest (ADR-019 §4) --------------------------------------------
	// Digest rules whose window has elapsed and that have something to say. A rule
	// with nothing pending is not woken up: an empty digest is noise.
	ListDigestRulesDue(ctx context.Context) ([]ListDigestRulesDueRow, error)
	ListDomainsForApplication(ctx context.Context, applicationID *int64) ([]Domain, error)
	// Enabled plans whose drill window has elapsed — managed databases AND stack
	// components. A plan that has never been drilled (last_drill_at IS NULL) is
	// due immediately: the first drill is the one that tells you whether the
	// backups were ever any good.
	ListDrillablePlans(ctx context.Context) ([]ListDrillablePlansRow, error)
	// The prober's work list: enabled checks whose window has passed (or was
	// never seeded). Owned by the scheduler leader — no extra locking needed.
	ListDueUptimeChecks(ctx context.Context) ([]UptimeCheck, error)
	// What the sign-in page shows: enabled providers only, and nothing secret.
	ListEnabledOauthProviderConfigs(ctx context.Context) ([]ListEnabledOauthProviderConfigsRow, error)
	// Envelope-encryption inventory (ADR-003, data-dictionary §12). The first
	// 4 bytes of every *_enc column carry the key version that encrypted it.
	//
	// Nothing here names a table. The inventory is derived from the schema by
	// `encryption_inventory()` (migration 00093) and everything below reads it, so
	// a new *_enc column is rotated and observed without touching this file. A
	// hand-kept list is what let the histogram report a converged rotation while
	// 16 columns still held the old key.
	// The inventory itself: [{"tbl","col"}, ...] over every encrypted column of the
	// schema. Drives the rotation loop, so what gets rewritten IS what exists.
	ListEncryptedColumns(ctx context.Context) ([]byte, error)
	ListEnvVarsForDeploy(ctx context.Context, resourceID int64) ([]EnvironmentVariable, error)
	// The production set by default; the dedicated preview set on demand (§5.6):
	// the platform-generated preview credentials live there, and an operator who
	// cannot read them cannot open their own protected preview.
	ListEnvVarsPage(ctx context.Context, arg ListEnvVarsPageParams) ([]EnvironmentVariable, error)
	ListEnvironmentsPage(ctx context.Context, arg ListEnvironmentsPageParams) ([]Environment, error)
	ListEnvironmentsSummary(ctx context.Context, projectID int64) ([]Environment, error)
	// Retention (§7.2): the count and age rules are cumulative — a backup expires
	// if it falls outside EITHER — and 0 means unlimited. The last successful
	// backup of a plan is never dropped, whatever the rules say.
	ListExpiredLocalBackups(ctx context.Context, arg ListExpiredLocalBackupsParams) ([]ListExpiredLocalBackupsRow, error)
	// TTL of inactivity (§20.4.3): based on the last deployment or activity.
	ListExpiredPreviews(ctx context.Context) ([]Preview, error)
	// Same rules, applied to the objects in the bucket. A backup can outlive its
	// local copy in S3, or the reverse — the two retentions are independent.
	ListExpiredS3Backups(ctx context.Context, arg ListExpiredS3BackupsParams) ([]ListExpiredS3BackupsRow, error)
	// Newest first: the audit question is almost always "who has access right
	// now", so the cursor walks ids downwards.
	ListExternalEndpointGrantsPage(ctx context.Context, arg ListExternalEndpointGrantsPageParams) ([]ListExternalEndpointGrantsPageRow, error)
	ListExternalEndpointsPage(ctx context.Context, arg ListExternalEndpointsPageParams) ([]ExternalEndpoint, error)
	ListGithubAppsPage(ctx context.Context, arg ListGithubAppsPageParams) ([]GithubApp, error)
	ListIdentitiesForUser(ctx context.Context, userID int64) ([]Identity, error)
	ListIngressEndpoints(ctx context.Context, teamID int64) ([]ListIngressEndpointsRow, error)
	ListIngressSessionsPage(ctx context.Context, arg ListIngressSessionsPageParams) ([]ListIngressSessionsPageRow, error)
	// Instance-wide audit (reserved to the instance root): every team AND the
	// system/instance actions that have no team_id (encryption rotation, instance
	// settings…), which no team-scoped view can show. Same optional filters.
	ListInstanceAuditEventsPage(ctx context.Context, arg ListInstanceAuditEventsPageParams) ([]AuditEvent, error)
	ListInvitationsPage(ctx context.Context, arg ListInvitationsPageParams) ([]ListInvitationsPageRow, error)
	ListJobsPage(ctx context.Context, arg ListJobsPageParams) ([]Job, error)
	// Revoking a grant tears down the sessions it opened; this is that set.
	ListLivePortForwardSessionsByGrant(ctx context.Context, grantID *int64) ([]PortForwardSession, error)
	// Network-prune exclusion (§3.7): a sleeping scale-to-zero preview's stack
	// network looks unused to Docker (stopped containers hold no endpoints), but
	// pruning it breaks the wake — only networks whose preview is DESTROYED are
	// orphans.
	ListLivePreviewUUIDs(ctx context.Context, uuids []pgtype.UUID) ([]pgtype.UUID, error)
	// Scan exclusion (INV-015): "managed" means tracked by a live row, not just
	// labelled — a disowned resource keeps its labels but is adoptable again.
	ListLiveResourceUUIDs(ctx context.Context, uuids []pgtype.UUID) ([]pgtype.UUID, error)
	ListMcpAccessTokensForTeam(ctx context.Context, teamID int64) ([]McpAccessToken, error)
	// Notifications (§11, ADR-019).
	ListNotificationChannelsPage(ctx context.Context, arg ListNotificationChannelsPageParams) ([]NotificationChannel, error)
	ListNotificationRules(ctx context.Context, channelID int64) ([]NotificationRule, error)
	// OAuth/OIDC dashboard login (PRD §10.2, §23.3): provider credentials,
	// in-flight login states, and the identities an account is linked to.
	ListOauthProviderConfigs(ctx context.Context) ([]OauthProviderConfig, error)
	// Every event, whatever its team: the rules decide who hears about it.
	ListOutboxEventsAfter(ctx context.Context, arg ListOutboxEventsAfterParams) ([]OutboxEvent, error)
	ListOutboxEventsForTeamAfter(ctx context.Context, arg ListOutboxEventsForTeamAfterParams) ([]OutboxEvent, error)
	ListPasskeysForUser(ctx context.Context, userID int64) ([]PasskeyCredential, error)
	// What the digest of this rule stands for.
	ListPendingDigestDeliveries(ctx context.Context, ruleID int64) ([]ListPendingDigestDeliveriesRow, error)
	// Every still-pending invitation issued to an email. Used by the OAuth/SSO
	// signup path: an invitation authorizes account creation even when open
	// registration is off — the admin who issued it vouched for this exact address.
	ListPendingInvitationsByEmail(ctx context.Context, email string) ([]ListPendingInvitationsByEmailRow, error)
	// The operator's view of the team's tunnels. Newest first, like the grant list:
	// the question asked is almost always "what is forwarded right now". The joins
	// are LEFT because a session outlives its user and its endpoint — a row whose
	// target was deleted still has to be readable, or the audit trail has holes
	// exactly where something was removed.
	ListPortForwardSessionsPage(ctx context.Context, arg ListPortForwardSessionsPageParams) ([]ListPortForwardSessionsPageRow, error)
	// Same, scoped to one preview: its images live under akerdock/<preview_uuid>,
	// a namespace distinct from production (deployment engine §5.7).
	ListPreviewArtifactsOnServer(ctx context.Context, arg ListPreviewArtifactsOnServerParams) ([]ListPreviewArtifactsOnServerRow, error)
	// The DEDICATED preview variable set (INV-010): production secrets are never
	// copied implicitly. Per-PR overrides sit on top: a row carrying THIS
	// preview's id wins over the shared set's same key.
	ListPreviewEnvVars(ctx context.Context, arg ListPreviewEnvVarsParams) ([]EnvironmentVariable, error)
	ListPreviewsForApplication(ctx context.Context, applicationID int64) ([]Preview, error)
	// Scale-to-zero (ADR-036): active previews whose application opted in, with the
	// app's idle window. The scheduler reads each preview's waker activity file over
	// SSH and sleeps the ones idle past their window.
	ListPreviewsForScaleToZero(ctx context.Context) ([]ListPreviewsForScaleToZeroRow, error)
	// Active previews at least 80% into their inactivity TTL and not yet warned —
	// the heads-up window before ListExpiredPreviews reaps them.
	ListPreviewsToWarn(ctx context.Context) ([]Preview, error)
	// Which of these keys are actually referenced — by a server or as an
	// application's deploy key. Answered in one round trip so a key listing does
	// not fan out into one query per row.
	ListPrivateKeyIDsInUse(ctx context.Context, keyIds []int64) ([]int64, error)
	ListPrivateKeysPage(ctx context.Context, arg ListPrivateKeysPageParams) ([]PrivateKey, error)
	ListProjectsPage(ctx context.Context, arg ListProjectsPageParams) ([]Project, error)
	// Promoted by the scheduler when capacity frees up (§20.4.3).
	ListQueuedPreviews(ctx context.Context) ([]Preview, error)
	// The build servers of a team that can actually take a build. A build server
	// that is not ready is not a build server: dispatching to it would fail the
	// deployment for a reason that has nothing to do with the application.
	ListReadyBuildServers(ctx context.Context, teamID int64) ([]Server, error)
	// Every server the agent must run on (ADR-052): Docker operations flow
	// through the command channel, so the helper is ensured on ALL ready servers
	// — build servers and database-only hosts included, proxy or not.
	ListReadyServers(ctx context.Context) ([]Server, error)
	ListRegistryCredentialsPage(ctx context.Context, arg ListRegistryCredentialsPageParams) ([]RegistryCredential, error)
	ListRepositoriesForSource(ctx context.Context, gitSourceID int64) ([]Repository, error)
	ListRestoreDrillsPage(ctx context.Context, arg ListRestoreDrillsPageParams) ([]ListRestoreDrillsPageRow, error)
	// S3 storages (§7.2, data-dictionary §6.6). Credentials are envelope-encrypted
	// and never leave the instance (INV-003).
	ListS3StoragesPage(ctx context.Context, arg ListS3StoragesPageParams) ([]S3Storage, error)
	// Enabled plans of non-deleted targets — managed databases AND stack
	// components (compose-spec §10). The scheduler owns the cron: it seeds
	// next_run_at when it is NULL and fires the plans that are due.
	// target_resource_id is the stack resource for a component plan: it is what
	// jobs and events hang off.
	ListSchedulableBackupPlans(ctx context.Context) ([]ListSchedulableBackupPlansRow, error)
	// Every enabled task of a live resource. The scheduler decides what is due:
	// a task whose next_run_at is NULL has never been scheduled and must be
	// seeded, so it cannot be filtered out here.
	ListSchedulableTasks(ctx context.Context) ([]ListSchedulableTasksRow, error)
	ListScheduledTasksPage(ctx context.Context, arg ListScheduledTasksPageParams) ([]ListScheduledTasksPageRow, error)
	ListScimTokensPage(ctx context.Context, teamID int64) ([]ScimToken, error)
	ListServerDomains(ctx context.Context, serverID int64) ([]ListServerDomainsRow, error)
	// Server inventory (§3): only managed resources appear here (INV-015).
	ListServerResourcesPage(ctx context.Context, arg ListServerResourcesPageParams) ([]ListServerResourcesPageRow, error)
	ListServersPage(ctx context.Context, arg ListServersPageParams) ([]Server, error)
	// Servers whose routing the reconciler converges. A proxy the operator
	// DELIBERATELY stopped (§3) is excluded: re-applying its files would be
	// harmless, but the drift loop exists to repair accidents — and an intent is
	// not an accident.
	ListServersWithProxy(ctx context.Context) ([]Server, error)
	ListServiceComponentDomains(ctx context.Context, serviceComponentID *int64) ([]Domain, error)
	ListServiceComponents(ctx context.Context, resourceID int64) ([]ServiceComponent, error)
	ListServiceStacksPage(ctx context.Context, arg ListServiceStacksPageParams) ([]ListServiceStacksPageRow, error)
	// Everything a deployment of this resource inherits (§5.4): the team's
	// variables, the ones of its project and environment, and the server-scoped
	// variables of its destination server.
	ListSharedVariablesForResource(ctx context.Context, resourceID int64) ([]SharedVariable, error)
	ListSharedVariablesPage(ctx context.Context, arg ListSharedVariablesPageParams) ([]SharedVariable, error)
	// Applications currently asleep (ADR-037): the scheduler flips them back to
	// awake when the waker has served them again (fresh activity after slept_at).
	ListSleepingApplications(ctx context.Context) ([]ListSleepingApplicationsRow, error)
	// Sleeping previews (ADR-036): the scheduler checks whether the waker has woken
	// them (fresh activity) and flips their status back to active.
	ListSleepingPreviews(ctx context.Context) ([]Preview, error)
	ListStoragesForResource(ctx context.Context, resourceID int64) ([]PersistentStorage, error)
	// Every public port routed through the proxy on a server. It is the set the
	// static config must declare: Traefik cannot add a listener at runtime.
	ListTCPProxyPorts(ctx context.Context, serverID int64) ([]*int32, error)
	ListTagsForResource(ctx context.Context, resourceID int64) ([]string, error)
	ListTaskExecutionsPage(ctx context.Context, arg ListTaskExecutionsPageParams) ([]TaskExecution, error)
	// SCIM Users/Groups source: every member with its effective role (system role,
	// or the custom role uuid when set) so groups (=roles) can be assembled in Go.
	ListTeamMembersForScim(ctx context.Context, teamID int64) ([]ListTeamMembersForScimRow, error)
	ListTeamMembersPage(ctx context.Context, arg ListTeamMembersPageParams) ([]ListTeamMembersPageRow, error)
	// Every team the user may act in — the source of the dashboard's team switcher.
	// Deliberately NOT /teams (which lists the instance's teams for the root): the
	// switcher must offer memberships only, or switching would become a way to
	// enter a team nobody added you to.
	ListTeamMembershipsForUser(ctx context.Context, userID int64) ([]ListTeamMembershipsForUserRow, error)
	ListTeamsPage(ctx context.Context, arg ListTeamsPageParams) ([]Team, error)
	// The seeded localhost server, while it has never passed a validation
	// (instance-config §6.2): the scheduler retries it until the instance key is
	// authorized on the host. Bounded to 24h after creation so a host that will
	// never run SSH does not accumulate a failed job every tick forever — past
	// the window, validation stays a click away in the UI.
	ListUnvalidatedLocalhostServers(ctx context.Context) ([]Server, error)
	ListUptimeChecksPage(ctx context.Context, arg ListUptimeChecksPageParams) ([]UptimeCheck, error)
	ListUptimeResultsPage(ctx context.Context, arg ListUptimeResultsPageParams) ([]UptimeCheckResult, error)
	MarkBackupLocalDeleted(ctx context.Context, id int64) error
	MarkBackupS3Deleted(ctx context.Context, id int64) error
	MarkCertificateAlerted(ctx context.Context, arg MarkCertificateAlertedParams) error
	MarkDigestDeliveriesFailed(ctx context.Context, arg MarkDigestDeliveriesFailedParams) error
	MarkDigestDeliveriesSent(ctx context.Context, deliveryIds []int64) error
	// Stamped from the agent's claim observation, never from an HTTP redeem: the
	// socket lives agent-side. Idempotent against replayed observations.
	MarkIngressSessionClaimed(ctx context.Context, uuid pgtype.UUID) (int64, error)
	MarkJobRunning(ctx context.Context, arg MarkJobRunningParams) (int64, error)
	// Records an explicit human deploy order (/deploy, /rebuild, the Previews
	// tab, a fork approval): under the manual-first policy the capacity queue
	// only promotes a queued preview once this is set (§20.4).
	MarkPreviewDeployRequested(ctx context.Context, id int64) error
	MarkProxyRevisionApplied(ctx context.Context, id int64) error
	MarkProxyRevisionFailed(ctx context.Context, arg MarkProxyRevisionFailedParams) error
	MarkProxyRevisionRolledBack(ctx context.Context, id int64) error
	// Stamped once, when the session's single data stream joins — affordable only
	// because a terminal has exactly one (ADR-065 §6). Read by the sweep alone: it
	// is what tells an abandoned claim from a live shell, and it is deliberately
	// not a re-claim condition.
	MarkTerminalSessionStreamed(ctx context.Context, id int64) (int64, error)
	// The rules that hear this event type, for this team, honouring the
	// project/environment scoping (NULL = the whole team).
	MatchNotificationRules(ctx context.Context, arg MatchNotificationRulesParams) ([]MatchNotificationRulesRow, error)
	// A resumed deployment continues the step numbering of the attempt that
	// crashed: restarting at 1 would collide with the steps already recorded, and
	// would also erase the history of what the dead worker had done.
	MaxDeploymentStepSeq(ctx context.Context, deploymentID int64) (int32, error)
	// Lowest free port in the dynamic range for a server (§6.2); the unique
	// index remains the authority against concurrent allocation.
	NextFreePublicPort(ctx context.Context, serverID int64) (int32, error)
	// Trust-on-first-use (§20.1): the fingerprint is written only when none is
	// pinned yet. Overwriting it here would defeat the whole point — a changed key
	// must fail the connection, not silently re-pin itself.
	PinServerHostKey(ctx context.Context, arg PinServerHostKeyParams) error
	PromoteWaitingJobs(ctx context.Context) (int64, error)
	// Retention purge (§23.4): removes audit rows older than retention_days. Goes
	// through the SQL function (not a direct DELETE) — the function is the only
	// sanctioned path past the append-only trigger, and it caps the deletion to
	// aged-out rows. retention_days <= 0 keeps everything. Returns rows removed.
	PurgeAuditEvents(ctx context.Context, retentionDays int32) (int64, error)
	PurgeCliAuthCodes(ctx context.Context) (int64, error)
	PurgeExpiredMfaChallenges(ctx context.Context) (int64, error)
	PurgeExpiredOauthLoginStates(ctx context.Context) (int64, error)
	PurgeExpiredPasskeyCeremonies(ctx context.Context) (int64, error)
	PurgeExpiredSessions(ctx context.Context) (int64, error)
	PurgeIdempotencyKeys(ctx context.Context) error
	PurgeIngressSessions(ctx context.Context) (int64, error)
	PurgePortForwardSessions(ctx context.Context, retentionDays int32) (int64, error)
	// Never purge past the notification cursor: an event the dispatcher has not
	// read yet would be a notification silently lost (the 7-day window makes this
	// unlikely, not impossible — a long outage is exactly when alerts matter).
	PurgePublishedOutboxEvents(ctx context.Context) (int64, error)
	// Retention (§19.2, §22.2): terminal jobs are purged; dead_letter rows are
	// kept until an operator retries or forgets them.
	PurgeTerminalJobs(ctx context.Context, retentionDays int32) (int64, error)
	PurgeTerminalSessions(ctx context.Context, retentionDays int32) (int64, error)
	// History retention (§19.2): raw probe results are bounded; the check row
	// keeps the current verdict forever.
	PurgeUptimeResults(ctx context.Context, retentionDays int32) (int64, error)
	// Retention bounds the dedup window: purging too aggressively would reopen the
	// replay window (INV-009), hence 30 days minimum.
	PurgeWebhookDeliveries(ctx context.Context) (int64, error)
	// Reaper (INV-013): expired leases go back to the queue via retry_wait, or
	// to dead_letter when attempts are exhausted. Handlers must inspect the
	// remote effect before redoing work (§21.3).
	// A crashed worker is not a failed job (§2.5): the attempt is GIVEN BACK
	// (attempt - 1) so a deployment with max_attempts = 1 can still be resumed —
	// the resume inspects the remote state first, it never replays blindly.
	// resume_count bounds it: a job that kills its worker every time is dead-
	// lettered instead of looping forever.
	ReapExpiredLeases(ctx context.Context, maxResumes int32) ([]ReapExpiredLeasesRow, error)
	// An attached port-forward is activity (ADR-032 with ADR-037): the tunnel goes
	// straight to the container's IP over SSH, so the waker — which only records
	// what the PROXY serves — never sees it, and the scheduler would stop the
	// container the developer is connected to. Keyed on the resource id, which is
	// the application's own id. A database or a compose stack targeted by a tunnel
	// matches no row here, which is the intended no-op: neither has scale-to-zero.
	RecordApplicationActivity(ctx context.Context, id int64) error
	// Counts the failure and locks the account past the threshold. Returns the row
	// so the caller can tell "locked now" from "still open".
	RecordFailedLogin(ctx context.Context, arg RecordFailedLoginParams) (RecordFailedLoginRow, error)
	// A machine signal: an attached port-forward proves somebody is connected to
	// this preview (ADR-032 with ADR-036), which the waker cannot see — it only
	// records PROXIED HTTP, and a tunnel bypasses the proxy entirely.
	//
	// Deliberately NOT KeepPreviewAlive. That one also clears expiry_warned_at,
	// which records that a HUMAN asked to keep the preview; a heartbeat must not
	// forge that consent. updated_at is left alone for a sharper reason: on a
	// sleeping preview it carries the instant we slept it, and bumping it every
	// 20 s would push the wake comparison out of reach forever.
	RecordPreviewActivity(ctx context.Context, id int64) error
	RecordServerFacts(ctx context.Context, arg RecordServerFactsParams) error
	RecordUptimeResult(ctx context.Context, arg RecordUptimeResultParams) error
	// Built-in MCP server (ADR-043): OAuth 2.1 for remote clients. Everything
	// here is read-only in effect — a grant only ever reads one team's inventory.
	RegisterMcpOauthClient(ctx context.Context, arg RegisterMcpOauthClientParams) (McpOauthClient, error)
	// Deprovision: drop the membership (the account and its sessions are handled
	// separately). Team-scoped by the member's user UUID.
	RemoveTeamMemberByUUID(ctx context.Context, arg RemoveTeamMemberByUUIDParams) (int64, error)
	// Deliberate re-pin, on an explicit re-validation of a rebuilt server.
	RepinServerHostKey(ctx context.Context, arg RepinServerHostKeyParams) error
	ReplaceMfaRecoveryCodes(ctx context.Context, arg ReplaceMfaRecoveryCodesParams) (int64, error)
	// Cooperative cancellation (§2.6): the worker checks the flag at each
	// checkpoint between steps, before the switching barrier (§21.1).
	RequestDeploymentJobCancel(ctx context.Context, deploymentID int64) (int64, error)
	// The display name of what an action touched, read at the moment it is audited
	// so the trail keeps the name the resource had THEN (see 00084).
	//
	// One statement rather than fifteen: each branch is gated by the target kind, so
	// PostgreSQL discards the others on a constant one-time filter and only the
	// matching table is probed, by its unique index on uuid. Best-effort by
	// construction — an unknown kind or a row already gone simply yields nothing,
	// and the trail keeps the uuid it already has.
	ResolveAuditTargetName(ctx context.Context, arg ResolveAuditTargetNameParams) (string, error)
	// Which project/environment a resource belongs to, for rule scoping.
	ResolveProjectEnvironmentOfResource(ctx context.Context, uuid pgtype.UUID) (ResolveProjectEnvironmentOfResourceRow, error)
	// Used on logout-everywhere and on any credential change: a password reset that
	// leaves old sessions alive has reset nothing.
	RevokeAllSessionsOfUser(ctx context.Context, userID int64) (int64, error)
	RevokeApiTokenByUUID(ctx context.Context, arg RevokeApiTokenByUUIDParams) (int64, error)
	// Deprovision: revoke every API token the user holds in this team.
	RevokeApiTokensForUserInTeam(ctx context.Context, arg RevokeApiTokensForUserInTeamParams) (int64, error)
	RevokeExternalEndpointGrant(ctx context.Context, arg RevokeExternalEndpointGrantParams) (ExternalEndpointGrant, error)
	RevokeInvitation(ctx context.Context, arg RevokeInvitationParams) (int64, error)
	RevokeMcpAccessToken(ctx context.Context, arg RevokeMcpAccessTokenParams) (int64, error)
	RevokeScimToken(ctx context.Context, arg RevokeScimTokenParams) (int64, error)
	RevokeSession(ctx context.Context, id int64) error
	// Regenerate the link of a still-pending invitation: rotate the token hash and
	// push the expiry out. Returns nothing if the invitation is not pending.
	RotateInvitation(ctx context.Context, arg RotateInvitationParams) (Invitation, error)
	// Seeds the ACME contact on an instance that predates the setting. The database
	// stays authoritative: an existing value is never overwritten by the variable.
	SetAcmeEmailIfAbsent(ctx context.Context, acmeEmail *string) (int64, error)
	SetAdoptionScanRunning(ctx context.Context, id int64) error
	// Instance settings mutations (§14.2).
	SetApiEnabled(ctx context.Context, apiEnabled bool) (InstanceSetting, error)
	SetApplicationAccessBasicAuth(ctx context.Context, arg SetApplicationAccessBasicAuthParams) error
	SetApplicationAccessProtection(ctx context.Context, arg SetApplicationAccessProtectionParams) error
	SetApplicationAccessPublicRoutes(ctx context.Context, arg SetApplicationAccessPublicRoutesParams) error
	SetApplicationAwake(ctx context.Context, id int64) error
	// Links an application to a git source after creation — used when a provider
	// API token arrives on an application whose public repository needed no source
	// row until now (amendment 31).
	SetApplicationGitSource(ctx context.Context, arg SetApplicationGitSourceParams) error
	SetApplicationSlept(ctx context.Context, id int64) error
	// Restore drills (ADR-014). A backup that has never been restored is a file,
	// not a backup.
	SetBackupExecutionTableCount(ctx context.Context, arg SetBackupExecutionTableCountParams) error
	// Advances the plan's cron window. Written by the scheduler only, so it does
	// not bump `version` (it is not a user-visible edit and must not conflict
	// with an optimistic-locking PATCH).
	SetBackupPlanSchedule(ctx context.Context, arg SetBackupPlanScheduleParams) error
	SetCertificateStatus(ctx context.Context, arg SetCertificateStatusParams) error
	SetDeploymentCommit(ctx context.Context, arg SetDeploymentCommitParams) error
	// Author name and subject of the resolved commit, read on the build server
	// after checkout — surfaces "who last pushed" in the deployment view. Best
	// effort: a missing value leaves the column untouched.
	SetDeploymentCommitMeta(ctx context.Context, arg SetDeploymentCommitMetaParams) error
	SetDeploymentError(ctx context.Context, arg SetDeploymentErrorParams) error
	SetDeploymentImage(ctx context.Context, arg SetDeploymentImageParams) error
	SetDeploymentImageDigest(ctx context.Context, arg SetDeploymentImageDigestParams) error
	SetDeploymentStatus(ctx context.Context, arg SetDeploymentStatusParams) error
	// Live output of a RUNNING step (docker build, container start): the SSE log
	// stream polls the steps every second, so refreshing the log as the command
	// runs is what turns "step build: started … (silence)" into a console.
	SetDeploymentStepLog(ctx context.Context, arg SetDeploymentStepLogParams) error
	// Write-only provider API token (INV-003): stored envelope-encrypted, NULL
	// removes it. Funds the degraded preview feedback and command rights checks
	// (protocols §3-§6).
	SetGitSourceAPIToken(ctx context.Context, arg SetGitSourceAPITokenParams) error
	// Self-hosted API endpoint (protocols §4.1/§6.1); NULL falls back to the
	// derivation from the repository host.
	SetGitSourceAPIURL(ctx context.Context, arg SetGitSourceAPIURLParams) error
	// First of the two redundant installation signals wins (§2.1 step 7).
	SetGithubAppInstallation(ctx context.Context, arg SetGithubAppInstallationParams) (int64, error)
	// Rollback image retention (ADR-006, §29.4). The CHECK (>= 1) keeps the live
	// image protected even at the smallest setting.
	SetImageRetentionCount(ctx context.Context, imageRetentionCount int32) (InstanceSetting, error)
	// FQDN + contact ACME (§14.2) : la base fait foi après le premier démarrage,
	// c'est donc ici — et nulle part ailleurs — qu'ils se modifient.
	SetInstanceIdentity(ctx context.Context, arg SetInstanceIdentityParams) (InstanceSetting, error)
	SetInstanceMcpDcrEnabled(ctx context.Context, mcpDcrEnabled bool) error
	SetInstanceMcpEnabled(ctx context.Context, mcpEnabled bool) error
	SetLocalhostSeeded(ctx context.Context) (int64, error)
	SetMembershipExternalID(ctx context.Context, arg SetMembershipExternalIDParams) error
	SetMfaRequired(ctx context.Context, mfaRequired bool) (InstanceSetting, error)
	SetNotificationCursor(ctx context.Context, lastOutboxEventID int64) error
	SetOtlpConfig(ctx context.Context, otlpConfigEnc []byte) error
	SetPasswordLoginDisabled(ctx context.Context, passwordLoginDisabled bool) (InstanceSetting, error)
	SetPlanDrillResult(ctx context.Context, arg SetPlanDrillResultParams) error
	// A renewed grant pushes back the deadline of the sessions it opened, so a
	// transfer in flight survives instead of restarting from zero (ADR-045 §5).
	SetPortForwardAuthorizedUntil(ctx context.Context, arg SetPortForwardAuthorizedUntilParams) error
	// Back to the running state after a waker-driven wake; clears the expiry warning
	// so an active preview is never mistaken for one about to be reaped.
	SetPreviewAwake(ctx context.Context, id int64) error
	SetPreviewDeployed(ctx context.Context, id int64) error
	SetPreviewExpiryWarned(ctx context.Context, id int64) error
	SetPreviewFqdn(ctx context.Context, arg SetPreviewFqdnParams) error
	// Generated once at scaffolding; the stable value behind {{random}} (ADR-035).
	SetPreviewRandomSlug(ctx context.Context, arg SetPreviewRandomSlugParams) error
	SetPreviewSleeping(ctx context.Context, id int64) error
	SetPreviewStatus(ctx context.Context, arg SetPreviewStatusParams) error
	// The operator's intent on the proxy (§3): an explicit stop must survive the
	// drift reconciliation — a proxy someone deliberately stopped is not drift.
	SetProxyDesiredState(ctx context.Context, arg SetProxyDesiredStateParams) error
	SetProxyObservedStatus(ctx context.Context, arg SetProxyObservedStatusParams) error
	// Open/close self-service signup (§10.2). Closed is the default; with SSO an
	// invitation still authorizes account creation regardless of this flag.
	SetRegistrationEnabled(ctx context.Context, registrationEnabled bool) (InstanceSetting, error)
	// Marks a resource as adopted and not yet normalized: the JSONB points at
	// the real remote objects (container name, compose project).
	SetResourceAdoption(ctx context.Context, arg SetResourceAdoptionParams) error
	SetResourceDesiredStatus(ctx context.Context, arg SetResourceDesiredStatusParams) error
	SetResourceObservedStatus(ctx context.Context, arg SetResourceObservedStatusParams) error
	// What a failed deletion left behind on the server (§20.6.4). Recorded so the
	// operator can retry, or forget with an explicit acknowledgement — a forget
	// never cleans anything up remotely, it only stops pretending the job matters.
	SetResourceRemnants(ctx context.Context, arg SetResourceRemnantsParams) error
	SetRuleDigestFlushed(ctx context.Context, id int64) error
	SetS3StorageCheck(ctx context.Context, arg SetS3StorageCheckParams) error
	SetScheduledTaskSchedule(ctx context.Context, arg SetScheduledTaskScheduleParams) error
	SetServerCA(ctx context.Context, arg SetServerCAParams) error
	// Scheduler-owned: never bumps `version` (not a user edit).
	SetServerCleanupSchedule(ctx context.Context, arg SetServerCleanupScheduleParams) error
	SetServerStatus(ctx context.Context, arg SetServerStatusParams) error
	SetServiceAccessBasicAuth(ctx context.Context, arg SetServiceAccessBasicAuthParams) error
	SetServiceAccessProtection(ctx context.Context, arg SetServiceAccessProtectionParams) error
	SetServiceComponentObserved(ctx context.Context, arg SetServiceComponentObservedParams) error
	// Agent ingestion (ADR-040): refresh a component's observed state from a
	// pushed Docker event, scoped to the resource's server. No-op when the state
	// is unchanged, so at-least-once delivery stays idempotent.
	SetServiceComponentObservedByName(ctx context.Context, arg SetServiceComponentObservedByNameParams) (int64, error)
	SetServiceNoindex(ctx context.Context, arg SetServiceNoindexParams) error
	// Moves a live session into another team (PRD §37). Revoked sessions are not
	// matched: nothing may be done through a session that is already dead.
	SetSessionCurrentTeam(ctx context.Context, arg SetSessionCurrentTeamParams) (int64, error)
	// Passkey step-up (rbac-matrix §5): stamps the browser session; freshness is
	// judged by the caller against the step-up window.
	SetSessionMfaVerified(ctx context.Context, id int64) error
	// TOTP step-up (ADR-045 §5). Deliberately a SEPARATE column from the passkey
	// marker: `mfa_verified_at` means "recent passkey", the root terminal requires
	// that ritual, and letting a TOTP set it would hand every TOTP-only user a root
	// shell.
	SetSessionTotpVerified(ctx context.Context, id int64) error
	// Enter or leave the role-inspection mode (ADR-058). Both arguments null =
	// leave; the CHECK constraint keeps the two sources exclusive. Nothing here
	// verifies authority: the caller does, against the session's REAL membership.
	SetSessionViewAs(ctx context.Context, arg SetSessionViewAsParams) error
	SetTransactionalEmailConfig(ctx context.Context, transactionalEmailConfigEnc []byte) error
	// The prober's state write: counters, verdict, and the next window. Never
	// bumps `version` (not a user edit — it must not conflict with a PATCH).
	SetUptimeCheckState(ctx context.Context, arg SetUptimeCheckStateParams) error
	// Remembers the team across sessions, so the next login opens where the user
	// left off rather than on their oldest team.
	SetUserLastTeam(ctx context.Context, arg SetUserLastTeamParams) error
	SoftDeleteBackupPlan(ctx context.Context, id int64) (int64, error)
	SoftDeleteDNSCredential(ctx context.Context, id int64) (int64, error)
	SoftDeleteEnvironment(ctx context.Context, id int64) (int64, error)
	SoftDeleteProject(ctx context.Context, id int64) (int64, error)
	SoftDeleteProjectEnvironments(ctx context.Context, projectID int64) error
	SoftDeleteRegistryCredential(ctx context.Context, id int64) (int64, error)
	SoftDeleteResource(ctx context.Context, id int64) (int64, error)
	SoftDeleteScheduledTask(ctx context.Context, id int64) (int64, error)
	SoftDeleteServer(ctx context.Context, id int64) (int64, error)
	SoftDeleteUptimeCheck(ctx context.Context, id int64) (int64, error)
	// Atomic counterpart of CanStartServerCleanup. The first deployment
	// transition and the cleanup guard serialize on the same server row. A
	// cleanup is identified from the durable job itself, so a worker crash keeps
	// deployments out until its lease is reaped; no in-memory mutex can provide
	// that guarantee across replicas.
	StartDeploymentUnlessCleanupRunning(ctx context.Context, deploymentID int64) (int64, error)
	SucceedJob(ctx context.Context, arg SucceedJobParams) (int64, error)
	// §20.4.7 (opt-in preview_cancel_obsolete_builds): a new commit makes the
	// in-flight preview build obsolete. Queued deployments flip here; running
	// ones get a cooperative cancel (RequestDeploymentJobCancel) — never past
	// the traffic switch (§21.1).
	SupersedeObsoletePreviewDeployments(ctx context.Context, arg SupersedeObsoletePreviewDeploymentsParams) ([]int64, error)
	// Coalescing (§3.4): a queued webhook deployment for the same application
	// is superseded by a newer one; an already leased/running deployment is
	// never coalesced.
	SupersedeQueuedDeployments(ctx context.Context, arg SupersedeQueuedDeploymentsParams) ([]int64, error)
	// Leader-side finalization of rows whose socket can no longer answer for
	// itself: an unclaimed token past its TTL, a claimed session whose agent went
	// silent (no report for 90 s), or one past the 12 h ceiling (ADR-060 §6).
	// The derived reason keeps the audit line and the CLI message coherent.
	SweepIngressSessions(ctx context.Context) ([]IngressTunnelSession, error)
	// Finalize rows whose socket cannot still be alive. A non-NULL heartbeat names
	// a bridge from this release or later; legacy NULL rows are left alone until
	// the protocol's hard four-hour ceiling so an N-1 replica remains compatible.
	SweepPortForwardSessions(ctx context.Context) ([]SweepPortForwardSessionsRow, error)
	// Crash net: sessions live in-process, so a row left open past any possible
	// lifetime is a control-plane restart, not a session. Unclaimed expired
	// tokens are closed as revoked.
	//
	// The third clause is what bounds ADR-065's abandoned attach. A client that
	// vanished between the session request and its data stream now leaves the row
	// claimed and re-claimable instead of ended, and this table has no heartbeat to
	// age it: without this, that row would hold one of the twenty per-team slots
	// until the max-duration ceiling. A claimed row that never carried its PTY is
	// therefore closed once its token dies — the slot is held for at most the TTL
	// plus one sweep interval — and as disconnect, which is what happened.
	SweepTerminalSessions(ctx context.Context, maxDurationSeconds int32) (int64, error)
	TagResource(ctx context.Context, arg TagResourceParams) error
	// Consumes the code: a replay finds nothing (DELETE … RETURNING).
	TakeMcpOauthCode(ctx context.Context, codeHash string) (McpOauthCode, error)
	TouchAgentTokenSeen(ctx context.Context, id int64) error
	TouchApiTokenLastUsed(ctx context.Context, id int64) error
	// Agent-reported liveness. Zero rows means the durable session was finalized
	// (operator close, sweep) and the caller must cut the socket.
	TouchIngressSession(ctx context.Context, uuid pgtype.UUID) (int64, error)
	TouchMcpAccessToken(ctx context.Context, id int64) error
	// The anti-replay gate (data-dictionary §4.3): last_used_at holds the start
	// of the last accepted TOTP step, and only a strictly later step may pass.
	// Enforced in SQL so two concurrent verifications of the same code cannot
	// both win, whatever the callers do.
	TouchMfaFactorUsed(ctx context.Context, arg TouchMfaFactorUsedParams) (int64, error)
	TouchScimTokenUsed(ctx context.Context, id int64) error
	TouchSession(ctx context.Context, id int64) error
	// Git pipeline settings of a git application (PATCH /applications): a nil
	// argument leaves the column alone — partial like the rest of the update.
	// watch_paths carries a set flag because an explicit empty list must CLEAR
	// the column ("deploy on every push again"), not keep it.
	UpdateApplicationGitSettings(ctx context.Context, arg UpdateApplicationGitSettingsParams) error
	UpdateApplicationPreviewSettings(ctx context.Context, arg UpdateApplicationPreviewSettingsParams) error
	// Scale-to-zero of the application itself (ADR-037), separate from previews.
	UpdateApplicationScaleToZero(ctx context.Context, arg UpdateApplicationScaleToZeroParams) error
	UpdateBackupPlan(ctx context.Context, arg UpdateBackupPlanParams) (int64, error)
	// Build-pack side of the same PATCH. publish_directory carries a set flag:
	// an explicit null means "no publish step anymore", a COALESCE would keep it.
	UpdateBuildConfigGitPipeline(ctx context.Context, arg UpdateBuildConfigGitPipelineParams) error
	UpdateBuildConfigSource(ctx context.Context, arg UpdateBuildConfigSourceParams) error
	// Partial update: name/description/permissions. Permissions arrive already
	// validated and closed under prerequisites by the handler.
	UpdateCustomRole(ctx context.Context, arg UpdateCustomRoleParams) (CustomRole, error)
	UpdateDatabasePassword(ctx context.Context, arg UpdateDatabasePasswordParams) error
	UpdateDatabaseRow(ctx context.Context, arg UpdateDatabaseRowParams) error
	UpdateEnvVar(ctx context.Context, arg UpdateEnvVarParams) (EnvironmentVariable, error)
	UpdateEnvironment(ctx context.Context, arg UpdateEnvironmentParams) (int64, error)
	UpdateExternalEndpoint(ctx context.Context, arg UpdateExternalEndpointParams) (ExternalEndpoint, error)
	// The FQDN and the server are immutable after declaration: both are baked into
	// the issued certificate and the deposited router. Renaming the URL is a
	// delete + declare, which is what it costs everywhere else in the product.
	UpdateIngressEndpoint(ctx context.Context, arg UpdateIngressEndpointParams) (IngressEndpoint, error)
	UpdateJobSteps(ctx context.Context, arg UpdateJobStepsParams) error
	UpdateNotificationChannel(ctx context.Context, arg UpdateNotificationChannelParams) (int64, error)
	// Called after every successful assertion: the sign counter moved, and the
	// clone-detection logic downstream depends on it being persisted.
	UpdatePasskeyCredential(ctx context.Context, arg UpdatePasskeyCredentialParams) error
	UpdatePrivateKey(ctx context.Context, arg UpdatePrivateKeyParams) (int64, error)
	UpdateProject(ctx context.Context, arg UpdateProjectParams) (int64, error)
	UpdateRegistryCredential(ctx context.Context, arg UpdateRegistryCredentialParams) (int64, error)
	UpdateResourceMeta(ctx context.Context, arg UpdateResourceMetaParams) (int64, error)
	UpdateRuntimeSettings(ctx context.Context, arg UpdateRuntimeSettingsParams) error
	UpdateS3Storage(ctx context.Context, arg UpdateS3StorageParams) (int64, error)
	UpdateScheduledTask(ctx context.Context, arg UpdateScheduledTaskParams) (int64, error)
	UpdateServer(ctx context.Context, arg UpdateServerParams) (int64, error)
	UpdateServiceCompose(ctx context.Context, arg UpdateServiceComposeParams) (int64, error)
	UpdateSharedVariable(ctx context.Context, arg UpdateSharedVariableParams) (int64, error)
	// Partial update of a team's name/description (§10.1).
	UpdateTeam(ctx context.Context, arg UpdateTeamParams) (Team, error)
	// Set a member's system role and (re)assign or clear its custom role. When
	// custom_role_id is non-null it overrides the system role at resolution time;
	// role is kept as the fallback. Team-scoped by the member's user UUID.
	UpdateTeamMemberRole(ctx context.Context, arg UpdateTeamMemberRoleParams) (int64, error)
	UpdateUptimeCheck(ctx context.Context, arg UpdateUptimeCheckParams) (int64, error)
	// Certificates: observed reflection of the server state (§18.3).
	UpsertCertificate(ctx context.Context, arg UpsertCertificateParams) error
	// Health checks (§8.8): one row per resource, gate the rolling update.
	UpsertHealthCheck(ctx context.Context, arg UpsertHealthCheckParams) (HealthCheck, error)
	// Full replacement, secret included: the API never reads the secret back, so
	// there is nothing to "keep" on update — the caller re-provides it.
	UpsertOauthProviderConfig(ctx context.Context, arg UpsertOauthProviderConfigParams) (OauthProviderConfig, error)
	// PR previews (data-dictionary §8.9, §20.4).
	// New commit on the same PR reuses the identity — the instance redeploys,
	// it is never duplicated (§20.4). A destroyed preview row is revived when
	// the PR reopens.
	UpsertPreview(ctx context.Context, arg UpsertPreviewParams) (Preview, error)
	// Discovery cache (§7.3): external_id is the identity — a rename updates
	// full_name on the same row.
	UpsertRepository(ctx context.Context, arg UpsertRepositoryParams) (Repository, error)
	// Component sync (data-dictionary §9.2): recreated/updated at every edit of
	// the compose file. The upsert keeps the row identity (uuid, backup plans,
	// domains) stable for components that survive the edit.
	UpsertServiceComponent(ctx context.Context, arg UpsertServiceComponentParams) (ServiceComponent, error)
	// Tags (§5.4): used by the deploy webhook (?tag=).
	UpsertTag(ctx context.Context, arg UpsertTagParams) (Tag, error)
	// Setup creates the factor, or replaces one that was never confirmed (the
	// user scanned a QR code, closed the tab, started over). A CONFIRMED factor
	// is never replaced this way — the WHERE arms the conflict update only for
	// unconfirmed rows, so setup over an active factor returns no row and the
	// caller answers 409. The uuid is generated by the caller: the envelope AAD
	// binds the ciphertext to it before the insert.
	UpsertUnconfirmedMfaFactor(ctx context.Context, arg UpsertUnconfirmedMfaFactorParams) (MfaFactor, error)
	// Agent ingestion (ADR-040): flip a slept scale-to-zero application back to
	// awake, only when its resource lives on the given server. Returns the
	// resource id so the caller can emit the woken event; no row = nothing slept.
	WakeSleptApplicationForServer(ctx context.Context, arg WakeSleptApplicationForServerParams) (int64, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AcceptInvitation

func (q *Queries) AcceptInvitation(ctx context.Context, tokenHash string) (AcceptInvitationRow, error)

Atomically claim a still-pending invitation by its link hash: the WHERE clause is the single-use guard (accepted/revoked/expired all fail to match). Returns the target team, role and optional custom role so the caller can add the membership. Team-scoping is inherent — the invitation names its own team.

func (*Queries) AcceptInvitationByID

func (q *Queries) AcceptInvitationByID(ctx context.Context, id int64) (AcceptInvitationByIDRow, error)

Atomically claim one pending invitation by id (the email-based signup already matched the address). Same single-use guard as AcceptInvitation; no match when it was revoked or expired between the listing and the claim.

func (*Queries) AddTeamMember

func (q *Queries) AddTeamMember(ctx context.Context, arg AddTeamMemberParams) error

func (*Queries) ApproveCliAuthCode

func (q *Queries) ApproveCliAuthCode(ctx context.Context, arg ApproveCliAuthCodeParams) (int64, error)

Bind the pending request to the approving user/team and permissions.

func (*Queries) ApprovePreviewFork

func (q *Queries) ApprovePreviewFork(ctx context.Context, arg ApprovePreviewForkParams) (int64, error)

func (*Queries) AssignDeploymentBuildServerUnlessCleanupRunning

func (q *Queries) AssignDeploymentBuildServerUnlessCleanupRunning(ctx context.Context, arg AssignDeploymentBuildServerUnlessCleanupRunningParams) (int64, error)

A build server is another mutation target of the deployment. Reserve it through the same reader/writer exclusion as the deployment server, before opening SSH or creating its working directory.

func (*Queries) CanStartServerCleanup

func (q *Queries) CanStartServerCleanup(ctx context.Context, serverID int64) (bool, error)

Reader/writer exclusion for §3.7. The cleanup job is already `running` when it reaches this query. Locking the server row makes this check atomic with StartDeploymentUnlessCleanupRunning: either the cleanup observes an active deployment and defers, or a queued deployment observes the running cleanup and waits before its first mutation. Queued deployments do not block a cleanup because they have not touched the server yet.

func (*Queries) CancelJobsForDeployments

func (q *Queries) CancelJobsForDeployments(ctx context.Context, deploymentIds []int64) error

func (*Queries) CancelQueuedDeployment

func (q *Queries) CancelQueuedDeployment(ctx context.Context, id int64) (int64, error)

func (*Queries) ClaimIdempotencyKey

func (q *Queries) ClaimIdempotencyKey(ctx context.Context, arg ClaimIdempotencyKeyParams) (ClaimIdempotencyKeyRow, error)

HTTP idempotency (§24.1). Inserts the key, or returns the existing row when the key was already used: the caller compares the request hash and replays the response.

func (*Queries) ClaimPortForwardSession

func (q *Queries) ClaimPortForwardSession(ctx context.Context, arg ClaimPortForwardSessionParams) (PortForwardSession, error)

Idempotent within the TTL, bound to the attacher (ADR-065): a first claim stamps the attacher's key hash, a re-claim must present the same one, and a different one matches zero rows — which is the replay the rule exists to stop. What one mint authorizes is one live SESSION, not one HTTP request; the ladder above this statement (ADR-064) retries, and a rung that gave up must not have destroyed what it was trying to open.

The right-hand sides read pre-update values, so claimed_at and started_at are pinned to the FIRST claim: a retry loop must not be able to buy itself extra duration by restarting the max-duration ceiling.

authorized_until is checked here as well as at mint (ADR-045). A grant revoked between two rungs already ends the row, so `ended_at IS NULL` catches it; this is the belt to that brace, because a re-claim is the one path that can arrive after an authorization changed.

func (*Queries) ClaimTerminalSession

func (q *Queries) ClaimTerminalSession(ctx context.Context, arg ClaimTerminalSessionParams) (TerminalSession, error)

Idempotent within the TTL, bound to the attacher (ADR-065): a first claim stamps the attacher's key hash, a re-claim must present the same one, a different one matches zero rows — which is the replay the rule exists to stop. The idempotence lives in the WHERE and nowhere else: read-then-write would race two rungs of the same ladder into two attaches that both believe they own the session, the one failure mode strict single-use never had.

started_at is reset at claim time so idle/max-duration windows measure the live session, not the gap between issuance and attach — but only on the FIRST claim. The right-hand sides read pre-update values, so coalesce and the attach_seq test pin both stamps to that claim; a retry loop must not buy itself duration. token_expires_at > now() is unchanged and is the whole of the re-claim window: there is no new lifetime here.

last_heartbeat_at is stamped here as well as on every beat (ADR-067 §1): the column means "the last moment this session was known alive", and a claim is such a moment. Leaving it NULL until the first beat twenty seconds later would make a shell that attached a second ago indistinguishable from a row written by a release that cannot heartbeat at all.

func (*Queries) ClaimUnpublishedOutboxEvents

func (q *Queries) ClaimUnpublishedOutboxEvents(ctx context.Context, limit int32) ([]OutboxEvent, error)

Outbox publisher (§18.2, §24.2): events are published in commit order.

func (*Queries) ClearFailedLogins

func (q *Queries) ClearFailedLogins(ctx context.Context, id int64) error

func (*Queries) ClearGithubAppInstallation

func (q *Queries) ClearGithubAppInstallation(ctx context.Context, id int64) (int64, error)

installation deleted/suspended (§2.4): the source is degraded, not removed.

func (*Queries) ClearMfaPendingForUser

func (q *Queries) ClearMfaPendingForUser(ctx context.Context, userID int64) error

Lift the forced-enrollment gate on all of a user's sessions once they confirm an MFA factor (ADR — mfa_required).

func (*Queries) ClearResourceAdoption

func (q *Queries) ClearResourceAdoption(ctx context.Context, id int64) error

The normalizing deployment converged the remote objects onto the uuid-derived names (§20.7): the pointer is obsolete, the history stays.

func (*Queries) ClearResourceTags

func (q *Queries) ClearResourceTags(ctx context.Context, resourceID int64) error

func (*Queries) ClearViewAsForCustomRole

func (q *Queries) ClearViewAsForCustomRole(ctx context.Context, viewAsCustomRoleID *int64) (int64, error)

A custom role that stops existing must not leave sessions simulating it. The FK already nulls the id; this clears the sessions of a role whose permissions changed enough that the simulation is stale.

func (*Queries) CompleteAdoptionScan

func (q *Queries) CompleteAdoptionScan(ctx context.Context, arg CompleteAdoptionScanParams) error

func (*Queries) CompleteGithubAppConversion

func (q *Queries) CompleteGithubAppConversion(ctx context.Context, arg CompleteGithubAppConversionParams) (GithubApp, error)

Conversion (protocols §2.1 step 5): persist what GitHub returned, clear the state so the callback cannot be replayed.

func (*Queries) CompleteIdempotencyKey

func (q *Queries) CompleteIdempotencyKey(ctx context.Context, arg CompleteIdempotencyKeyParams) error

func (*Queries) ConfirmMfaFactor

func (q *Queries) ConfirmMfaFactor(ctx context.Context, arg ConfirmMfaFactorParams) (MfaFactor, error)

The first valid code turns the factor on and seeds the recovery codes. last_used_at is set to the matched TOTP step so that very first code is already replay-protected.

func (*Queries) ConsumeCliAuthCode

func (q *Queries) ConsumeCliAuthCode(ctx context.Context, requestIDHash string) (CliAuthorizationCode, error)

Single-use: the token exchange claims the approved request atomically.

func (*Queries) ConsumeMfaChallenge

func (q *Queries) ConsumeMfaChallenge(ctx context.Context, tokenHash string) (MfaChallenge, error)

DELETE ... RETURNING on success only: two concurrent verifications of the same challenge cannot both mint a session.

func (*Queries) ConsumeMfaRecoveryCode

func (q *Queries) ConsumeMfaRecoveryCode(ctx context.Context, arg ConsumeMfaRecoveryCodeParams) (int64, error)

Single-use by construction: the matched hash is removed in the same statement that accepts it.

func (*Queries) ConsumeOauthLoginState

func (q *Queries) ConsumeOauthLoginState(ctx context.Context, arg ConsumeOauthLoginStateParams) (OauthLoginState, error)

DELETE ... RETURNING: the state is single-use by construction — a replayed callback finds nothing, whatever the caller does. Provider and purpose are part of the lookup, not hints: a GitHub login state must not complete a Google callback, nor a login state a link.

func (*Queries) ConsumePasskeyCeremony

func (q *Queries) ConsumePasskeyCeremony(ctx context.Context, arg ConsumePasskeyCeremonyParams) (PasskeyCeremony, error)

DELETE ... RETURNING makes the ceremony single-use by construction: two concurrent finishes cannot both win, whatever the caller does.

func (*Queries) CountActiveDeploymentsForServer

func (q *Queries) CountActiveDeploymentsForServer(ctx context.Context, serverID int64) (int64, error)

func (*Queries) CountActiveJobsByLockKey

func (q *Queries) CountActiveJobsByLockKey(ctx context.Context, lockKey *string) (int64, error)

func (*Queries) CountApplicationsUsingPrivateKey

func (q *Queries) CountApplicationsUsingPrivateKey(ctx context.Context, privateKeyID *int64) (int64, error)

Applications cloning through a deploy key backed by this key. A key still in use is not deletable (§19.2) — reported as a conflict, not as a foreign key error.

func (*Queries) CountAuditEvents

func (q *Queries) CountAuditEvents(ctx context.Context) (int64, error)

func (*Queries) CountBackupPlansUsingS3Storage

func (q *Queries) CountBackupPlansUsingS3Storage(ctx context.Context, s3StorageID *int64) (int64, error)

func (*Queries) CountCredentialsForUser

func (q *Queries) CountCredentialsForUser(ctx context.Context, id int64) (int32, error)

How many ways this user can still sign in: a password, federated identities, passkeys. Unlinking the LAST one would lock the account out silently — the caller refuses when this reaches one.

func (*Queries) CountCustomRoleMembers

func (q *Queries) CountCustomRoleMembers(ctx context.Context, customRoleID *int64) (int64, error)

func (*Queries) CountDNSCredentialUsage

func (q *Queries) CountDNSCredentialUsage(ctx context.Context, dnsCredentialID *int64) (int64, error)

func (*Queries) CountLivePreviewsForApplication

func (q *Queries) CountLivePreviewsForApplication(ctx context.Context, applicationID int64) (int64, error)

The concurrency cap (§20.4.3) counts everything that consumes the server.

func (*Queries) CountOpenIngressSessions

func (q *Queries) CountOpenIngressSessions(ctx context.Context, teamID int64) (int64, error)

func (*Queries) CountOpenPortForwardSessions

func (q *Queries) CountOpenPortForwardSessions(ctx context.Context, teamID int64) (int64, error)

func (*Queries) CountOpenTerminalSessions

func (q *Queries) CountOpenTerminalSessions(ctx context.Context, teamID int64) (int64, error)

Live sessions plus still-claimable tokens: both hold a slot of the per-team cap, otherwise issuing tokens in a burst would bypass it.

func (*Queries) CountPasskeysForUser

func (q *Queries) CountPasskeysForUser(ctx context.Context, userID int64) (int64, error)

A passkey requires user verification (possession + biometric/PIN), so it is an MFA-grade factor in its own right: forced MFA enrolment (§10.2) is satisfied by one, not only by a TOTP secret.

func (*Queries) CountRegistryCredentialUsage

func (q *Queries) CountRegistryCredentialUsage(ctx context.Context, credentialID *int64) (int32, error)

A credential still referenced by a build config or by a rollback artifact cannot be deleted: the deployment that depends on it would stop being able to pull its own image (§19.2).

func (*Queries) CountResourcesByEnvironment

func (q *Queries) CountResourcesByEnvironment(ctx context.Context, environmentIds []int64) ([]CountResourcesByEnvironmentRow, error)

Live resources per environment, in one round trip: a per-row count would fan out into one query per environment on every project listing.

func (*Queries) CountResourcesInEnvironment

func (q *Queries) CountResourcesInEnvironment(ctx context.Context, environmentID int64) (int64, error)

func (*Queries) CountResourcesInProject

func (q *Queries) CountResourcesInProject(ctx context.Context, projectID int64) (int64, error)

func (*Queries) CountResourcesOnServer

func (q *Queries) CountResourcesOnServer(ctx context.Context, serverID int64) (int64, error)

func (*Queries) CountRunningRestoreDrills

func (q *Queries) CountRunningRestoreDrills(ctx context.Context, planID int64) (int64, error)

func (*Queries) CountRunningTaskExecutions

func (q *Queries) CountRunningTaskExecutions(ctx context.Context, scheduledTaskID int64) (int64, error)

func (*Queries) CountServersUsingPrivateKey

func (q *Queries) CountServersUsingPrivateKey(ctx context.Context, privateKeyID int64) (int64, error)

func (*Queries) CountSuppressedSince

func (q *Queries) CountSuppressedSince(ctx context.Context, arg CountSuppressedSinceParams) (int64, error)

How many events this rule swallowed since its last send — an aggregated alert must be able to say "and 12 others" rather than hide them (ADR-019).

func (*Queries) CountTeamAdmins

func (q *Queries) CountTeamAdmins(ctx context.Context, teamID int64) (int64, error)

Effective admins: a member carrying a custom role is NOT an admin, whatever the fallback role column says. Guards against removing the last admin.

func (*Queries) CountUsers

func (q *Queries) CountUsers(ctx context.Context) (int64, error)

Queries used by the startup sequence (instance-config §6).

func (*Queries) CreateAdoptedStorage

func (q *Queries) CreateAdoptedStorage(ctx context.Context, arg CreateAdoptedStorageParams) (PersistentStorage, error)

Adoption (§20.7): external_name keeps the original Docker volume name so the normalizing redeployment remounts the SAME data (INV-008).

func (*Queries) CreateAdoptionScan

func (q *Queries) CreateAdoptionScan(ctx context.Context, arg CreateAdoptionScanParams) (AdoptionScan, error)

Adoption scans (PRD §20.7, ADR-013/ADR-023).

func (*Queries) CreateAgentToken

func (q *Queries) CreateAgentToken(ctx context.Context, arg CreateAgentTokenParams) (AgentToken, error)

The uuid is generated app-side: it is the envelope-encryption context of token_enc, so a replaced row MUST carry the uuid its ciphertext was bound to — hence uuid = excluded.uuid on conflict.

func (*Queries) CreateApiToken

func (q *Queries) CreateApiToken(ctx context.Context, arg CreateApiTokenParams) (ApiToken, error)

created_by is the human who minted the token, and it is NOT bookkeeping: the middleware intersects a token's permissions with its creator's on every request (rbac-matrix §4.2), so a token without one is a token nothing can narrow when its creator is demoted or leaves. It is also how a CLI token is tied back to the person an access grant was issued to (ADR-045 §5).

func (*Queries) CreateApplicationAccessToken

func (q *Queries) CreateApplicationAccessToken(ctx context.Context, arg CreateApplicationAccessTokenParams) error

ADR-042: application access wall — only the HASH is stored, the cookie value never touches the base (same rule as previews, ADR-030).

func (*Queries) CreateApplicationRow

func (q *Queries) CreateApplicationRow(ctx context.Context, arg CreateApplicationRowParams) error

func (*Queries) CreateBackupExecution

func (q *Queries) CreateBackupExecution(ctx context.Context, arg CreateBackupExecutionParams) (BackupExecution, error)

func (*Queries) CreateBackupPlan

func (q *Queries) CreateBackupPlan(ctx context.Context, arg CreateBackupPlanParams) (DatabaseBackupPlan, error)

Backups (§7, ADR-014). Target: a managed database OR an internal database of a compose stack (compose-spec §10) — the table CHECK enforces exactly one.

func (*Queries) CreateBuildConfig

func (q *Queries) CreateBuildConfig(ctx context.Context, arg CreateBuildConfigParams) error

func (*Queries) CreateCliAuthCode

func (q *Queries) CreateCliAuthCode(ctx context.Context, arg CreateCliAuthCodeParams) (CliAuthorizationCode, error)

CLI login requests (ADR-031, data-dictionary §10.8).

func (*Queries) CreateComponentDomain

func (q *Queries) CreateComponentDomain(ctx context.Context, arg CreateComponentDomainParams) (Domain, error)

Generated domain of a compose component (compose-spec §6): referencing SERVICE_FQDN_<ID> in the file is a declaration of intent — the domain is created from the server wildcard at first deployment.

func (*Queries) CreateCustomRole

func (q *Queries) CreateCustomRole(ctx context.Context, arg CreateCustomRoleParams) (CustomRole, error)

Rôles custom d'une team (ADR-038). Composés à partir des permissions granulaires du catalogue ; toujours team-scoped par team_id + uuid.

func (*Queries) CreateDNSCredential

func (q *Queries) CreateDNSCredential(ctx context.Context, arg CreateDNSCredentialParams) (CloudCredential, error)

DNS-01 credentials (proxy-contract §7.2). The config is never selected back out to the API: it is decrypted only to be materialized on the server.

func (*Queries) CreateDatabaseCredential

func (q *Queries) CreateDatabaseCredential(ctx context.Context, arg CreateDatabaseCredentialParams) (DatabaseCredential, error)

func (*Queries) CreateDatabaseRow

func (q *Queries) CreateDatabaseRow(ctx context.Context, arg CreateDatabaseRowParams) error

Managed databases (§6). Passwords are envelope encrypted; connection URLs are rebuilt on the fly, never stored assembled (§6.2).

func (*Queries) CreateDeployment

func (q *Queries) CreateDeployment(ctx context.Context, arg CreateDeploymentParams) (Deployment, error)

Deployments (state machine §21.1). Transitions are committed before the next remote action (write-ahead, deployment-engine §4).

func (*Queries) CreateDeploymentArtifact

func (q *Queries) CreateDeploymentArtifact(ctx context.Context, arg CreateDeploymentArtifactParams) error

Rollback artifacts (ADR-006, §10.3).

func (*Queries) CreateDeploymentStep

func (q *Queries) CreateDeploymentStep(ctx context.Context, arg CreateDeploymentStepParams) (int64, error)

func (*Queries) CreateDestination

func (q *Queries) CreateDestination(ctx context.Context, arg CreateDestinationParams) (Destination, error)

func (*Queries) CreateDomain

func (q *Queries) CreateDomain(ctx context.Context, arg CreateDomainParams) (Domain, error)

Domains (§4.2). Uniqueness (fqdn, path) is enforced by the table.

func (*Queries) CreateDraftGithubApp

func (q *Queries) CreateDraftGithubApp(ctx context.Context, arg CreateDraftGithubAppParams) (GithubApp, error)

GitHub Apps (data-dictionary §7.2, git-webhook-protocols §2) and the discovered-repositories cache (§7.3). Manifest flow step 1: the draft carries the state token (hashed, one-shot) the callback must present. Credentials arrive at conversion.

func (*Queries) CreateEndpointPortForwardSession

func (q *Queries) CreateEndpointPortForwardSession(ctx context.Context, arg CreateEndpointPortForwardSessionParams) (PortForwardSession, error)

The endpoint variant of CreatePortForwardSession: no resource, no preview, and an explicit `authorized_until` — the instant the session is actually cut, which the CLI is told at open and reminded of before it lands.

func (*Queries) CreateEnvVar

func (q *Queries) CreateEnvVar(ctx context.Context, arg CreateEnvVarParams) (EnvironmentVariable, error)

Environment variables (§5.4): the production set (is_preview = false) for the v1 endpoints; the preview set lands with previews.

func (*Queries) CreateEnvironment

func (q *Queries) CreateEnvironment(ctx context.Context, arg CreateEnvironmentParams) (Environment, error)

func (*Queries) CreateExternalEndpoint

func (q *Queries) CreateExternalEndpoint(ctx context.Context, arg CreateExternalEndpointParams) (ExternalEndpoint, error)

External endpoints and their access grants (ADR-045): declared bastion targets, and the bounded re-authenticated windows during which a user may mint tunnels to them.

func (*Queries) CreateExternalEndpointGrant

func (q *Queries) CreateExternalEndpointGrant(ctx context.Context, arg CreateExternalEndpointGrantParams) (ExternalEndpointGrant, error)

A grant is only ever created behind a fresh second factor; `factor` records which one was consumed, and `renewed_from` chains a renewal to the grant it extended so a long chain stays visible in the audit trail.

func (*Queries) CreateGeneratedEnvVar

func (q *Queries) CreateGeneratedEnvVar(ctx context.Context, arg CreateGeneratedEnvVarParams) (int64, error)

Magic variables (compose-spec §4.3): written at first use, is_generated, never regenerated while the row exists — the conflict target guarantees it.

func (*Queries) CreateGeneratedPreviewEnvVar

func (q *Queries) CreateGeneratedPreviewEnvVar(ctx context.Context, arg CreateGeneratedPreviewEnvVarParams) (int64, error)

Generated secret of the PREVIEW variable set (§20.4.4) — e.g. the basic auth credential. Same one-shot semantics as the magic variables.

func (*Queries) CreateGeneratedStorage

func (q *Queries) CreateGeneratedStorage(ctx context.Context, arg CreateGeneratedStorageParams) error

func (*Queries) CreateGitSource

func (q *Queries) CreateGitSource(ctx context.Context, arg CreateGitSourceParams) (GitSource, error)

func (*Queries) CreateGithubAppSource

func (q *Queries) CreateGithubAppSource(ctx context.Context, arg CreateGithubAppSourceParams) (GitSource, error)

One git source per converted app: what applications reference (INV-002).

func (*Queries) CreateIdentity

func (q *Queries) CreateIdentity(ctx context.Context, arg CreateIdentityParams) (Identity, error)

func (*Queries) CreateIngressAccessToken

func (q *Queries) CreateIngressAccessToken(ctx context.Context, arg CreateIngressAccessTokenParams) error

func (*Queries) CreateIngressDomain

func (q *Queries) CreateIngressDomain(ctx context.Context, arg CreateIngressDomainParams) (Domain, error)

func (*Queries) CreateIngressEndpoint

func (q *Queries) CreateIngressEndpoint(ctx context.Context, arg CreateIngressEndpointParams) (IngressEndpoint, error)

Ingress endpoints and their attach sessions (ADR-060). The mint/claim discipline mirrors portforwardsessions.sql, but the claim happens agent-side (the control plane only records what the agent reports), so there is no ClaimIngressSession here: the row is stamped from observations.

func (*Queries) CreateIngressSession

func (q *Queries) CreateIngressSession(ctx context.Context, arg CreateIngressSessionParams) (IngressTunnelSession, error)

func (*Queries) CreateInvitation

func (q *Queries) CreateInvitation(ctx context.Context, arg CreateInvitationParams) (Invitation, error)

Invitations (§10.1). The link token is hashed like any credential; the clear value is returned only once, at creation.

func (*Queries) CreateLocalhostServerIfAbsent

func (q *Queries) CreateLocalhostServerIfAbsent(ctx context.Context, arg CreateLocalhostServerIfAbsentParams) (int64, error)

ON CONFLICT: the operator may already have a server named "localhost" in that team — theirs wins, the seed backs off silently.

func (*Queries) CreateMcpAccessToken

func (q *Queries) CreateMcpAccessToken(ctx context.Context, arg CreateMcpAccessTokenParams) (McpAccessToken, error)

func (*Queries) CreateMcpOauthCode

func (q *Queries) CreateMcpOauthCode(ctx context.Context, arg CreateMcpOauthCodeParams) error

Single-use authorization code, PKCE challenge attached (ADR-043 §3).

func (*Queries) CreateMfaChallenge

func (q *Queries) CreateMfaChallenge(ctx context.Context, arg CreateMfaChallengeParams) error

func (*Queries) CreateNoBuildDeployment

func (q *Queries) CreateNoBuildDeployment(ctx context.Context, arg CreateNoBuildDeploymentParams) (Deployment, error)

A deployment that rebuilds nothing (ADR-048): the artifact is the one already running, the pipeline reruns to apply the current configuration. `image_digest` pins it when the artifact carries one, so what comes back up is provably the image that was running.

func (*Queries) CreateNotificationChannel

func (q *Queries) CreateNotificationChannel(ctx context.Context, arg CreateNotificationChannelParams) (NotificationChannel, error)

func (*Queries) CreateNotificationDelivery

func (q *Queries) CreateNotificationDelivery(ctx context.Context, arg CreateNotificationDeliveryParams) (NotificationDelivery, error)

ON CONFLICT DO NOTHING: re-reading an outbox event must never notify twice.

func (*Queries) CreateNotificationRule

func (q *Queries) CreateNotificationRule(ctx context.Context, arg CreateNotificationRuleParams) (NotificationRule, error)

func (*Queries) CreateOauthLoginState

func (q *Queries) CreateOauthLoginState(ctx context.Context, arg CreateOauthLoginStateParams) error

func (*Queries) CreatePasskeyCeremony

func (q *Queries) CreatePasskeyCeremony(ctx context.Context, arg CreatePasskeyCeremonyParams) error

func (*Queries) CreatePasskeyCredential

func (q *Queries) CreatePasskeyCredential(ctx context.Context, arg CreatePasskeyCredentialParams) (PasskeyCredential, error)

Passkeys (WebAuthn) for the dashboard login.

func (*Queries) CreatePersonalTeam

func (q *Queries) CreatePersonalTeam(ctx context.Context, name string) (Team, error)

func (*Queries) CreatePortForwardSession

func (q *Queries) CreatePortForwardSession(ctx context.Context, arg CreatePortForwardSessionParams) (PortForwardSession, error)

CLI TCP tunnel sessions (ADR-032, data-dictionary §10.7). Mirrors the terminal-session lifecycle.

func (*Queries) CreatePreviewAccessToken

func (q *Queries) CreatePreviewAccessToken(ctx context.Context, arg CreatePreviewAccessTokenParams) error

ADR-030: only the HASH is stored — the cookie value never touches the base.

func (*Queries) CreatePrivateKey

func (q *Queries) CreatePrivateKey(ctx context.Context, arg CreatePrivateKeyParams) (PrivateKey, error)

SSH private keys (§3.1, §23.2). The uuid is generated by the application so the envelope AAD (table || column || uuid) can bind the ciphertext to its row at insert time (data-dictionary §2.7).

func (*Queries) CreateProject

func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)

Projects and environments (§2, §19.2). All access is scoped by the authenticated team (INV-001); slugs are internal, derived from names.

func (*Queries) CreateProxyRevision

func (q *Queries) CreateProxyRevision(ctx context.Context, arg CreateProxyRevisionParams) (ProxyConfigRevision, error)

Proxy config revisions (§6.2–§6.4).

func (*Queries) CreateRegistryCredential

func (q *Queries) CreateRegistryCredential(ctx context.Context, arg CreateRegistryCredentialParams) (RegistryCredential, error)

Private registry credentials (data-dictionary §6.5). The password is never selected back out to the API: only the deployment engine decrypts it, and only to feed the stdin of `docker login` (INV-003).

func (*Queries) CreateResource

func (q *Queries) CreateResource(ctx context.Context, arg CreateResourceParams) (Resource, error)

Applications: union base resources + 1-1 extensions (§19.1).

func (*Queries) CreateResourceAccessToken

func (q *Queries) CreateResourceAccessToken(ctx context.Context, arg CreateResourceAccessTokenParams) error

ADR-049: the same hash-only grant for either an application or an inline Compose resource. application_id is also populated for applications during the rolling-upgrade window so an older API replica can validate the grant.

func (*Queries) CreateRestoreDrill

func (q *Queries) CreateRestoreDrill(ctx context.Context, arg CreateRestoreDrillParams) (RestoreDrill, error)

func (*Queries) CreateRollbackDeployment

func (q *Queries) CreateRollbackDeployment(ctx context.Context, arg CreateRollbackDeploymentParams) (Deployment, error)

func (*Queries) CreateRuntimeConfig

func (q *Queries) CreateRuntimeConfig(ctx context.Context, arg CreateRuntimeConfigParams) error

func (*Queries) CreateS3Storage

func (q *Queries) CreateS3Storage(ctx context.Context, arg CreateS3StorageParams) (S3Storage, error)

func (*Queries) CreateScheduledTask

func (q *Queries) CreateScheduledTask(ctx context.Context, arg CreateScheduledTaskParams) (ScheduledTask, error)

Scheduled tasks (§192). The scheduler owns next_run_at, exactly like the backup plans: the cron expression alone cannot tell whether an occurrence has already fired.

func (*Queries) CreateScimToken

func (q *Queries) CreateScimToken(ctx context.Context, arg CreateScimTokenParams) (ScimToken, error)

SCIM 2.0 provisioning (ADR-038 bis). A SCIM token is scoped to one team; the endpoints authenticate with it and act only within that team.

func (*Queries) CreateServer

func (q *Queries) CreateServer(ctx context.Context, arg CreateServerParams) (Server, error)

Servers (§3, state machine §21.2).

func (*Queries) CreateServiceRow

func (q *Queries) CreateServiceRow(ctx context.Context, arg CreateServiceRowParams) error

Compose stacks and their components (compose-spec.md, data-dictionary §9).

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)

func (*Queries) CreateSharedVariable

func (q *Queries) CreateSharedVariable(ctx context.Context, arg CreateSharedVariableParams) (SharedVariable, error)

Shared variables (§5.4, §3.1).

func (*Queries) CreateStorage

func (q *Queries) CreateStorage(ctx context.Context, arg CreateStorageParams) (PersistentStorage, error)

Persistent storages (§8).

func (*Queries) CreateTaskExecution

func (q *Queries) CreateTaskExecution(ctx context.Context, arg CreateTaskExecutionParams) (TaskExecution, error)

func (*Queries) CreateTeam

func (q *Queries) CreateTeam(ctx context.Context, arg CreateTeamParams) (Team, error)

A team created by the instance root (ADR-038): not personal — it exists to be shared, unlike the bootstrap team of a user.

func (*Queries) CreateTerminalSession

func (q *Queries) CreateTerminalSession(ctx context.Context, arg CreateTerminalSessionParams) (TerminalSession, error)

Web terminal sessions (PRD §5.7/§24.4, ADR-024, data-dictionary §10.6).

func (*Queries) CreateUptimeCheck

func (q *Queries) CreateUptimeCheck(ctx context.Context, arg CreateUptimeCheckParams) (UptimeCheck, error)

Uptime monitoring (ADR-017).

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) CreateWebhookDelivery

func (q *Queries) CreateWebhookDelivery(ctx context.Context, arg CreateWebhookDeliveryParams) (WebhookDelivery, error)

ON CONFLICT DO NOTHING: a redelivery keeps the provider's delivery id, so the unique constraint absorbs it — no second row, no second deployment.

func (*Queries) CreateWebhookEndpoint

func (q *Queries) CreateWebhookEndpoint(ctx context.Context, arg CreateWebhookEndpointParams) (WebhookEndpoint, error)

Incoming Git webhooks (§20.3, INV-009).

func (*Queries) DeleteComponentDomainsForResource

func (q *Queries) DeleteComponentDomainsForResource(ctx context.Context, resourceID int64) error

The compose components' domains (compose-spec §6). Deleted with the application: the (fqdn, path) uniqueness is GLOBAL and hard (INV-002) — a surviving row locks the URL against any future application, forever.

func (*Queries) DeleteCustomRole

func (q *Queries) DeleteCustomRole(ctx context.Context, arg DeleteCustomRoleParams) (int64, error)

func (*Queries) DeleteDeploymentArtifact

func (q *Queries) DeleteDeploymentArtifact(ctx context.Context, id int64) error

The image it referenced has been reclaimed: drop the now-dangling rollback pointer so it is never offered as a target.

func (*Queries) DeleteDomainsForApplication

func (q *Queries) DeleteDomainsForApplication(ctx context.Context, applicationID *int64) error

func (*Queries) DeleteEnvVar

func (q *Queries) DeleteEnvVar(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteEnvVarsNotInKeys

func (q *Queries) DeleteEnvVarsNotInKeys(ctx context.Context, arg DeleteEnvVarsNotInKeysParams) error

func (*Queries) DeleteExpiredMcpOauthCodes

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

func (*Queries) DeleteExpiredPreviewAccessTokens

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

func (*Queries) DeleteExternalEndpoint

func (q *Queries) DeleteExternalEndpoint(ctx context.Context, arg DeleteExternalEndpointParams) (int64, error)

func (*Queries) DeleteGeneratedStoragesForResource

func (q *Queries) DeleteGeneratedStoragesForResource(ctx context.Context, resourceID int64) error

The compose-mirrored rows (§2.4): rewritten wholesale at each deployment — the FILE is the source of truth, these rows only make it visible.

func (*Queries) DeleteGithubApp

func (q *Queries) DeleteGithubApp(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteIdentityForUser

func (q *Queries) DeleteIdentityForUser(ctx context.Context, arg DeleteIdentityForUserParams) (int64, error)

Scoped by user: a session must never unlink someone else's identity.

func (*Queries) DeleteIngressEndpoint

func (q *Queries) DeleteIngressEndpoint(ctx context.Context, arg DeleteIngressEndpointParams) (IngressEndpoint, error)

func (*Queries) DeleteMfaFactorForUser

func (q *Queries) DeleteMfaFactorForUser(ctx context.Context, userID int64) (int64, error)

func (*Queries) DeleteNotificationChannel

func (q *Queries) DeleteNotificationChannel(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteNotificationRule

func (q *Queries) DeleteNotificationRule(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteOauthProviderConfig

func (q *Queries) DeleteOauthProviderConfig(ctx context.Context, provider OauthProvider) (int64, error)

func (*Queries) DeletePasskeyForUser

func (q *Queries) DeletePasskeyForUser(ctx context.Context, arg DeletePasskeyForUserParams) (int64, error)

Scoped by user: a session must never be able to delete someone else's key.

func (*Queries) DeletePrivateKey

func (q *Queries) DeletePrivateKey(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteS3Storage

func (q *Queries) DeleteS3Storage(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteSharedVariable

func (q *Queries) DeleteSharedVariable(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteStorage

func (q *Queries) DeleteStorage(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteVanishedRepositories

func (q *Queries) DeleteVanishedRepositories(ctx context.Context, arg DeleteVanishedRepositoriesParams) (int64, error)

func (*Queries) DeleteVanishedServiceComponents

func (q *Queries) DeleteVanishedServiceComponents(ctx context.Context, arg DeleteVanishedServiceComponentsParams) (int64, error)

A service removed from the compose file loses its component row — and with it, by CASCADE, its domains and backup plans (explicit in the API response).

func (*Queries) DeleteWebhookEndpoint

func (q *Queries) DeleteWebhookEndpoint(ctx context.Context, id int64) (int64, error)

func (*Queries) DequeueJob

func (q *Queries) DequeueJob(ctx context.Context, arg DequeueJobParams) (Job, error)

func (*Queries) EncryptionKeyVersionHistogram

func (q *Queries) EncryptionKeyVersionHistogram(ctx context.Context) ([]byte, error)

[{"tbl","col","key_version","row_count"}, ...] over the WHOLE inventory. A rotation has converged once the active version is the only one left -- a claim that only holds because the inventory is exhaustive by construction.

func (*Queries) EncryptionRotationApply

func (q *Queries) EncryptionRotationApply(ctx context.Context, arg EncryptionRotationApplyParams) (int64, error)

Writes back one re-encrypted value, ciphertext only; returns rows written.

func (*Queries) EncryptionRotationCandidates

func (q *Queries) EncryptionRotationCandidates(ctx context.Context, arg EncryptionRotationCandidatesParams) ([]byte, error)

One batch of rows still on another key version, with the row identity bound into their AAD so the caller can decrypt and re-encrypt them.

func (*Queries) EndIngressSession

func (q *Queries) EndIngressSession(ctx context.Context, arg EndIngressSessionParams) (int64, error)

func (*Queries) EndIngressSessionByUUID

func (q *Queries) EndIngressSessionByUUID(ctx context.Context, arg EndIngressSessionByUUIDParams) (IngressTunnelSession, error)

func (*Queries) EndPortForwardSession

func (q *Queries) EndPortForwardSession(ctx context.Context, arg EndPortForwardSessionParams) (int64, error)

The optional generation is ADR-065 §5: an attach finalizes the session only while it is still THE attach, so a socket that lost a re-claim cannot close the row its successor is using. Revocation, the operator's close and the sweep pass NULL, because their verdict is about the session and not about whichever socket happens to hold it.

func (*Queries) EndTerminalSession

func (q *Queries) EndTerminalSession(ctx context.Context, arg EndTerminalSessionParams) (int64, error)

Idempotent: only the first close wins, so end_reason keeps the true cause when the WS teardown and a timeout race each other.

attach_seq is the optional generation guard of ADR-065 §5: an attach finalizes the session only while it is still THE attach, so a displaced one updates zero rows and the row stays open for the winner. Revocation, the operator cut and the sweep pass no generation and finalize unconditionally — their verdict is about the session, not about whichever socket holds it.

func (*Queries) EnqueueJob

func (q *Queries) EnqueueJob(ctx context.Context, arg EnqueueJobParams) (Job, error)

Durable job queue (ADR-002, §21.3). Dequeue uses FOR UPDATE SKIP LOCKED on the partial index of eligible jobs; lock_key exclusivity is enforced both here (NOT EXISTS) and by the partial unique index as the net.

func (*Queries) ExtendExternalEndpointGrant

func (q *Queries) ExtendExternalEndpointGrant(ctx context.Context, arg ExtendExternalEndpointGrantParams) (ExternalEndpointGrant, error)

Renewal pushes back an existing window in place. Guarded on the row still being live: a grant that expired between the ceremony and this statement is not renewable, it is a new request (ADR-045 §5).

func (*Queries) FailAdoptionScan

func (q *Queries) FailAdoptionScan(ctx context.Context, arg FailAdoptionScanParams) error

func (*Queries) FailJob

func (q *Queries) FailJob(ctx context.Context, arg FailJobParams) (int64, error)

func (*Queries) FinishBackupExecution

func (q *Queries) FinishBackupExecution(ctx context.Context, arg FinishBackupExecutionParams) error

func (*Queries) FinishDeploymentStep

func (q *Queries) FinishDeploymentStep(ctx context.Context, arg FinishDeploymentStepParams) error

func (*Queries) FinishNotificationDelivery

func (q *Queries) FinishNotificationDelivery(ctx context.Context, arg FinishNotificationDeliveryParams) error

func (*Queries) FinishRestoreDrill

func (q *Queries) FinishRestoreDrill(ctx context.Context, arg FinishRestoreDrillParams) error

func (*Queries) FinishTaskExecution

func (q *Queries) FinishTaskExecution(ctx context.Context, arg FinishTaskExecutionParams) error

func (*Queries) FinishWebhookDelivery

func (q *Queries) FinishWebhookDelivery(ctx context.Context, arg FinishWebhookDeliveryParams) error

func (*Queries) ForgetDeadLetterJob

func (q *Queries) ForgetDeadLetterJob(ctx context.Context, id int64) (int64, error)

func (*Queries) GetActiveApiTokensByPrefix

func (q *Queries) GetActiveApiTokensByPrefix(ctx context.Context, tokenPrefix string) ([]GetActiveApiTokensByPrefixRow, error)

Bearer token authentication (§10.3, ERD §12: prefix pre-filter then constant-time hash comparison in the application).

func (*Queries) GetAdoptionScanByID

func (q *Queries) GetAdoptionScanByID(ctx context.Context, id int64) (AdoptionScan, error)

func (*Queries) GetAgentTokenByHash

func (q *Queries) GetAgentTokenByHash(ctx context.Context, tokenHash string) (AgentToken, error)

func (*Queries) GetAgentTokenByServerID

func (q *Queries) GetAgentTokenByServerID(ctx context.Context, serverID int64) (AgentToken, error)

Per-server agent tokens (ADR-040): observations-only credentials for the server helper. One row per server; the plaintext survives encrypted so the idempotent provisioning re-injects the same token at every ensure pass.

func (*Queries) GetApplicationAccessByUUID

func (q *Queries) GetApplicationAccessByUUID(ctx context.Context, uuid pgtype.UUID) (GetApplicationAccessByUUIDRow, error)

The application behind a forward-auth call (identity carried in the middleware address, ADR-030's lesson about rewritten X-Forwarded-Host).

func (*Queries) GetApplicationByID

func (q *Queries) GetApplicationByID(ctx context.Context, id int64) (GetApplicationByIDRow, error)

func (*Queries) GetApplicationByRoutedHost

func (q *Queries) GetApplicationByRoutedHost(ctx context.Context, host string) (GetApplicationByRoutedHostRow, error)

Resolves a browser Host to the application that serves it (ADR-042): an application-level domain or a compose component's own domain.

func (*Queries) GetApplicationByUUID

func (q *Queries) GetApplicationByUUID(ctx context.Context, arg GetApplicationByUUIDParams) (GetApplicationByUUIDRow, error)

func (*Queries) GetArtifactByDigest

func (q *Queries) GetArtifactByDigest(ctx context.Context, arg GetArtifactByDigestParams) (DeploymentArtifact, error)

func (*Queries) GetArtifactForDeployment

func (q *Queries) GetArtifactForDeployment(ctx context.Context, arg GetArtifactForDeploymentParams) (DeploymentArtifact, error)

func (*Queries) GetBackupExecutionByID

func (q *Queries) GetBackupExecutionByID(ctx context.Context, id int64) (BackupExecution, error)

func (*Queries) GetBackupExecutionByUUID

func (q *Queries) GetBackupExecutionByUUID(ctx context.Context, arg GetBackupExecutionByUUIDParams) (BackupExecution, error)

func (*Queries) GetBackupPlanByID

func (q *Queries) GetBackupPlanByID(ctx context.Context, id int64) (DatabaseBackupPlan, error)

func (*Queries) GetBackupPlanByUUID

func (q *Queries) GetBackupPlanByUUID(ctx context.Context, arg GetBackupPlanByUUIDParams) (DatabaseBackupPlan, error)

func (*Queries) GetBackupPlanByUUIDForComponent

func (q *Queries) GetBackupPlanByUUIDForComponent(ctx context.Context, arg GetBackupPlanByUUIDForComponentParams) (DatabaseBackupPlan, error)

func (*Queries) GetCertificateByID

func (q *Queries) GetCertificateByID(ctx context.Context, id int64) (Certificate, error)

func (*Queries) GetCliAuthCodeByRequestHash

func (q *Queries) GetCliAuthCodeByRequestHash(ctx context.Context, requestIDHash string) (CliAuthorizationCode, error)

func (*Queries) GetComponentBackupTarget

func (q *Queries) GetComponentBackupTarget(ctx context.Context, id int64) (GetComponentBackupTargetRow, error)

Everything the backup job needs about a component plan's target: the component, its stack resource (container names derive from its uuid) and the server behind the stack's destination.

func (*Queries) GetCurrentArtifact

func (q *Queries) GetCurrentArtifact(ctx context.Context, resourceID int64) (DeploymentArtifact, error)

The artifact currently serving traffic: the one of the last succeeded deployment. This is what a skip_build deployment redeploys (ADR-048) — same image, fresh configuration.

func (*Queries) GetCurrentPreviewArtifact

func (q *Queries) GetCurrentPreviewArtifact(ctx context.Context, previewID *int64) (DeploymentArtifact, error)

Same, scoped to one PR instance: a preview never redeploys the production image (INV-010/INV-011).

func (*Queries) GetCustomRoleByID

func (q *Queries) GetCustomRoleByID(ctx context.Context, id int64) (CustomRole, error)

Read path of a simulated custom role (ADR-058): the session stores the id, and resolving it back to permissions happens on every authenticated request while the mode is on. The team is checked by the caller against the session's team.

func (*Queries) GetCustomRoleByUUID

func (q *Queries) GetCustomRoleByUUID(ctx context.Context, arg GetCustomRoleByUUIDParams) (CustomRole, error)

func (*Queries) GetDNSCredentialByID

func (q *Queries) GetDNSCredentialByID(ctx context.Context, id int64) (CloudCredential, error)

func (*Queries) GetDNSCredentialByUUID

func (q *Queries) GetDNSCredentialByUUID(ctx context.Context, arg GetDNSCredentialByUUIDParams) (CloudCredential, error)

func (*Queries) GetDatabaseByID

func (q *Queries) GetDatabaseByID(ctx context.Context, id int64) (GetDatabaseByIDRow, error)

func (*Queries) GetDatabaseByUUID

func (q *Queries) GetDatabaseByUUID(ctx context.Context, arg GetDatabaseByUUIDParams) (GetDatabaseByUUIDRow, error)

func (*Queries) GetDefaultDestination

func (q *Queries) GetDefaultDestination(ctx context.Context, serverID int64) (Destination, error)

func (*Queries) GetDeployKeySource

func (q *Queries) GetDeployKeySource(ctx context.Context, arg GetDeployKeySourceParams) (GitSource, error)

Git sources (§5.1, data-dictionary §7.1). One source per (team, deploy key): the API references keys, not sources, so reusing the same key for several applications must not multiply the rows.

func (*Queries) GetDeploymentByID

func (q *Queries) GetDeploymentByID(ctx context.Context, id int64) (Deployment, error)

func (*Queries) GetDeploymentByUUIDForTeam

The git repository URL and provider ride along (git source only) so the UI can link the branch, commit and PR back to the forge.

func (*Queries) GetDeploymentStatus

func (q *Queries) GetDeploymentStatus(ctx context.Context, deploymentID int64) (DeploymentStatus, error)

func (*Queries) GetDestinationByID

func (q *Queries) GetDestinationByID(ctx context.Context, id int64) (Destination, error)

func (*Queries) GetEnvVarByKey

func (q *Queries) GetEnvVarByKey(ctx context.Context, arg GetEnvVarByKeyParams) (EnvironmentVariable, error)

func (*Queries) GetEnvVarByUUID

func (q *Queries) GetEnvVarByUUID(ctx context.Context, arg GetEnvVarByUUIDParams) (EnvironmentVariable, error)

func (*Queries) GetEnvironmentByID

func (q *Queries) GetEnvironmentByID(ctx context.Context, id int64) (Environment, error)

func (*Queries) GetEnvironmentByUUID

func (q *Queries) GetEnvironmentByUUID(ctx context.Context, arg GetEnvironmentByUUIDParams) (Environment, error)

func (*Queries) GetEnvironmentByUUIDForTeam

func (q *Queries) GetEnvironmentByUUIDForTeam(ctx context.Context, arg GetEnvironmentByUUIDForTeamParams) (Environment, error)

Adoption targets an environment across projects: team isolation only (INV-002).

func (*Queries) GetExternalEndpointByID

func (q *Queries) GetExternalEndpointByID(ctx context.Context, id int64) (ExternalEndpoint, error)

func (*Queries) GetExternalEndpointByUUID

func (q *Queries) GetExternalEndpointByUUID(ctx context.Context, arg GetExternalEndpointByUUIDParams) (ExternalEndpoint, error)

func (*Queries) GetExternalEndpointGrantByUUID

func (q *Queries) GetExternalEndpointGrantByUUID(ctx context.Context, uuid pgtype.UUID) (ExternalEndpointGrant, error)

func (*Queries) GetGitSourceByID

func (q *Queries) GetGitSourceByID(ctx context.Context, id int64) (GitSource, error)

func (*Queries) GetGitSourceForGithubApp

func (q *Queries) GetGitSourceForGithubApp(ctx context.Context, githubAppID *int64) (GitSource, error)

func (*Queries) GetGithubAppByAppID

func (q *Queries) GetGithubAppByAppID(ctx context.Context, appID *int64) (GithubApp, error)

Webhook routing: X-GitHub-Hook-Installation-Target-ID names the app_id (§2.5) — instance-wide, the signature then proves the sender.

func (*Queries) GetGithubAppByID

func (q *Queries) GetGithubAppByID(ctx context.Context, id int64) (GithubApp, error)

func (*Queries) GetGithubAppByStateHash

func (q *Queries) GetGithubAppByStateHash(ctx context.Context, manifestStateHash *string) (GithubApp, error)

Callback resolution: the state is single-use and expiring — matched hashed, never logged (INV-003).

func (*Queries) GetGithubAppByUUID

func (q *Queries) GetGithubAppByUUID(ctx context.Context, arg GetGithubAppByUUIDParams) (GithubApp, error)

func (*Queries) GetGithubAppByUUIDAny

func (q *Queries) GetGithubAppByUUIDAny(ctx context.Context, uuid pgtype.UUID) (GithubApp, error)

Browser callbacks (manifest redirect, setup) carry no team context: the uuid alone resolves the app; the state/signature proves the caller.

func (*Queries) GetHealthCheck

func (q *Queries) GetHealthCheck(ctx context.Context, resourceID int64) (HealthCheck, error)

func (*Queries) GetIdentity

func (q *Queries) GetIdentity(ctx context.Context, arg GetIdentityParams) (Identity, error)

func (*Queries) GetIngressEndpointByFQDN

func (q *Queries) GetIngressEndpointByFQDN(ctx context.Context, fqdn string) (IngressEndpoint, error)

The authorize step resolves the redirect host to a declared endpoint — the sole anti-open-redirect rule, same as GetResourceByRoutedHost.

func (*Queries) GetIngressEndpointByID

func (q *Queries) GetIngressEndpointByID(ctx context.Context, id int64) (IngressEndpoint, error)

func (*Queries) GetIngressEndpointByUUID

func (q *Queries) GetIngressEndpointByUUID(ctx context.Context, arg GetIngressEndpointByUUIDParams) (IngressEndpoint, error)

func (*Queries) GetIngressEndpointByUUIDGlobal

func (q *Queries) GetIngressEndpointByUUIDGlobal(ctx context.Context, uuid pgtype.UUID) (IngressEndpoint, error)

Unscoped by design: the SSO wall's forward-auth is called by Traefik, which has no team — the reference travels in the middleware address (ADR-030).

func (*Queries) GetInstancePrivateKey

func (q *Queries) GetInstancePrivateKey(ctx context.Context) (PrivateKey, error)

func (*Queries) GetInstanceSettings

func (q *Queries) GetInstanceSettings(ctx context.Context) (InstanceSetting, error)

func (*Queries) GetJobByIdempotencyKey

func (q *Queries) GetJobByIdempotencyKey(ctx context.Context, idempotencyKey *string) (Job, error)

func (*Queries) GetJobByUUIDForTeam

func (q *Queries) GetJobByUUIDForTeam(ctx context.Context, arg GetJobByUUIDForTeamParams) (Job, error)

func (*Queries) GetJobUUIDByID

func (q *Queries) GetJobUUIDByID(ctx context.Context, id int64) (pgtype.UUID, error)

func (*Queries) GetLastAppliedProxyRevision

func (q *Queries) GetLastAppliedProxyRevision(ctx context.Context, arg GetLastAppliedProxyRevisionParams) (ProxyConfigRevision, error)

func (*Queries) GetLastSucceededDeployment

func (q *Queries) GetLastSucceededDeployment(ctx context.Context, resourceID int64) (Deployment, error)

What the application currently runs. A skip_build deployment (ADR-048) inherits its commit: it applies a configuration, never a new commit.

func (*Queries) GetLastSucceededPreviewDeployment

func (q *Queries) GetLastSucceededPreviewDeployment(ctx context.Context, previewID *int64) (Deployment, error)

Same, for one PR instance — pinned to the head SHA that instance runs.

func (*Queries) GetLatestSuccessfulBackupExecution

func (q *Queries) GetLatestSuccessfulBackupExecution(ctx context.Context, backupPlanID int64) (BackupExecution, error)

func (*Queries) GetLiveExternalEndpointGrant

func (q *Queries) GetLiveExternalEndpointGrant(ctx context.Context, arg GetLiveExternalEndpointGrantParams) (ExternalEndpointGrant, error)

The hot path on every mint: the caller's own live grant on this endpoint. Revoked and expired rows are invisible here, which is what makes revocation and expiry take effect without a sweep.

func (*Queries) GetMcpAccessTokenByHash

func (q *Queries) GetMcpAccessTokenByHash(ctx context.Context, tokenHash string) (GetMcpAccessTokenByHashRow, error)

A grant is valid only while its human still exists, still belongs to the granted team and that team still exists. Role/custom-role permissions ride with the row so every MCP request is authorized against CURRENT authority: removing or demoting a member converges immediately without a separate token revocation pass.

func (*Queries) GetMcpOauthClient

func (q *Queries) GetMcpOauthClient(ctx context.Context, clientID string) (McpOauthClient, error)

func (*Queries) GetMfaChallenge

func (q *Queries) GetMfaChallenge(ctx context.Context, tokenHash string) (MfaChallenge, error)

Read without consuming: a mistyped code must not send the user back to the password form — the account lockout is what bounds the guesses.

func (*Queries) GetMfaFactorForUser

func (q *Queries) GetMfaFactorForUser(ctx context.Context, userID int64) (MfaFactor, error)

2FA TOTP (PRD §10.2, §23.3): one factor per user, envelope-encrypted secret, hashed recovery codes, and the short-lived login challenges of a two-step login.

func (*Queries) GetNotificationChannelByID

func (q *Queries) GetNotificationChannelByID(ctx context.Context, id int64) (NotificationChannel, error)

func (*Queries) GetNotificationChannelByUUID

func (q *Queries) GetNotificationChannelByUUID(ctx context.Context, arg GetNotificationChannelByUUIDParams) (NotificationChannel, error)

func (*Queries) GetNotificationCursor

func (q *Queries) GetNotificationCursor(ctx context.Context) (int64, error)

func (*Queries) GetNotificationRuleByUUID

func (q *Queries) GetNotificationRuleByUUID(ctx context.Context, arg GetNotificationRuleByUUIDParams) (NotificationRule, error)

func (*Queries) GetOauthProviderConfig

func (q *Queries) GetOauthProviderConfig(ctx context.Context, provider OauthProvider) (OauthProviderConfig, error)

func (*Queries) GetOldestTeamID

func (q *Queries) GetOldestTeamID(ctx context.Context) (int64, error)

The localhost server lands in the first team of the instance — the root user's, by construction (§6.2).

func (*Queries) GetOpenIngressSessionByUUID

func (q *Queries) GetOpenIngressSessionByUUID(ctx context.Context, uuid pgtype.UUID) (IngressTunnelSession, error)

func (*Queries) GetOpenIngressSessionForEndpoint

func (q *Queries) GetOpenIngressSessionForEndpoint(ctx context.Context, endpointID *int64) (GetOpenIngressSessionForEndpointRow, error)

The occupancy probe (ADR-060 §6): the partial unique index makes at most one row match. "Open" means not ended — an unclaimed, unexpired mint occupies.

func (*Queries) GetPasskeyByCredentialID

func (q *Queries) GetPasskeyByCredentialID(ctx context.Context, credentialID []byte) (GetPasskeyByCredentialIDRow, error)

The login ceremony starts from the credential: the authenticator presents a credential id, and the user is whoever enrolled it. A deleted user's passkeys must not open sessions, hence the join.

func (*Queries) GetPendingInvitationByTokenHash

func (q *Queries) GetPendingInvitationByTokenHash(ctx context.Context, tokenHash string) (GetPendingInvitationByTokenHashRow, error)

Reads a still-pending invitation WITHOUT claiming it, so the landing page of an invitation link can say which team and which address it is for before asking the invitee to create their account. Same pending guard as the claim: an accepted, revoked or expired link resolves to nothing at all.

Returning the email is not an enumeration risk: the link token is a secret issued to that address, so holding it already proves possession of the invitation. Nothing here is reachable without it.

func (*Queries) GetPortForwardSessionByUUID

func (q *Queries) GetPortForwardSessionByUUID(ctx context.Context, arg GetPortForwardSessionByUUIDParams) (PortForwardSession, error)

func (*Queries) GetPortForwardSessionEndReason

func (q *Queries) GetPortForwardSessionEndReason(ctx context.Context, id int64) (*TerminalEndReason, error)

The terminal's twin (GetTerminalSessionEndReason), and for the same one caller: the beat above matched zero rows, so the reason this session ended with was written by somebody else — the sweep, a revocation, a grant that expired, a target that stopped — and it is on the row. Reading it is what keeps a cross-replica close from reaching the developer as `disconnect`.

Read at most once per session, on the beat that discovers the row is gone, which is why the liveness statement above is left alone: paying for this on every beat would buy nothing.

NULL means the row is still open — the supersession case of ADR-065 §5, not a finalized session — and the caller treats it as the `disconnect` fallback.

func (*Queries) GetPreviewAccessTokenByHash

func (q *Queries) GetPreviewAccessTokenByHash(ctx context.Context, tokenHash string) (PreviewAccessToken, error)

func (*Queries) GetPreviewByHost

func (q *Queries) GetPreviewByHost(ctx context.Context, host string) (Preview, error)

Resolves the browser's Host to a preview (ADR-030): the preview's own fqdn, or a compose service's derived `<service>-<fqdn>` (§20.4.1).

func (*Queries) GetPreviewByID

func (q *Queries) GetPreviewByID(ctx context.Context, id int64) (Preview, error)

func (*Queries) GetPreviewByIdentity

func (q *Queries) GetPreviewByIdentity(ctx context.Context, arg GetPreviewByIdentityParams) (Preview, error)

func (*Queries) GetPreviewByUUID

func (q *Queries) GetPreviewByUUID(ctx context.Context, uuid pgtype.UUID) (Preview, error)

func (*Queries) GetPreviewByUUIDForTeam

func (q *Queries) GetPreviewByUUIDForTeam(ctx context.Context, arg GetPreviewByUUIDForTeamParams) (Preview, error)

Team ownership travels through the application chain (INV-002).

func (*Queries) GetPreviousArtifact

func (q *Queries) GetPreviousArtifact(ctx context.Context, resourceID int64) (DeploymentArtifact, error)

The most recent artifact of a successful deployment other than the one currently serving traffic (the last succeeded deployment).

func (*Queries) GetPrivateKeyByID

func (q *Queries) GetPrivateKeyByID(ctx context.Context, id int64) (PrivateKey, error)

func (*Queries) GetPrivateKeyByUUID

func (q *Queries) GetPrivateKeyByUUID(ctx context.Context, arg GetPrivateKeyByUUIDParams) (PrivateKey, error)

func (*Queries) GetProjectByID

func (q *Queries) GetProjectByID(ctx context.Context, id int64) (Project, error)

func (*Queries) GetProjectByUUID

func (q *Queries) GetProjectByUUID(ctx context.Context, arg GetProjectByUUIDParams) (Project, error)

func (*Queries) GetRegistryCredentialByID

func (q *Queries) GetRegistryCredentialByID(ctx context.Context, id int64) (RegistryCredential, error)

func (*Queries) GetRegistryCredentialByUUID

func (q *Queries) GetRegistryCredentialByUUID(ctx context.Context, arg GetRegistryCredentialByUUIDParams) (RegistryCredential, error)

func (*Queries) GetRepositoryByFullName

func (q *Queries) GetRepositoryByFullName(ctx context.Context, arg GetRepositoryByFullNameParams) (Repository, error)

Exact match, never a prefix comparison (§23.5): webhook → resource.

func (*Queries) GetRepositoryByID

func (q *Queries) GetRepositoryByID(ctx context.Context, id int64) (Repository, error)

func (*Queries) GetResourceAccessByUUID

func (q *Queries) GetResourceAccessByUUID(ctx context.Context, uuid pgtype.UUID) (GetResourceAccessByUUIDRow, error)

ADR-049: access protection is shared by application and inline Compose resources. The identity is carried in the forwardAuth address.

func (*Queries) GetResourceByID

func (q *Queries) GetResourceByID(ctx context.Context, id int64) (Resource, error)

func (*Queries) GetResourceByRoutedHost

func (q *Queries) GetResourceByRoutedHost(ctx context.Context, arg GetResourceByRoutedHostParams) (GetResourceByRoutedHostRow, error)

Resolves the most specific application-level or per-component domain for the SSO callback's anti-open-redirect check. Host alone is insufficient: separate resources may legitimately own different paths of the same FQDN.

func (*Queries) GetResourceByUUIDForTeam

func (q *Queries) GetResourceByUUIDForTeam(ctx context.Context, arg GetResourceByUUIDForTeamParams) (Resource, error)

The optional resource link of a check (INV-002 isolation).

func (*Queries) GetResourceRemnants

func (q *Queries) GetResourceRemnants(ctx context.Context, id int64) ([]byte, error)

func (*Queries) GetS3StorageByID

func (q *Queries) GetS3StorageByID(ctx context.Context, id int64) (S3Storage, error)

func (*Queries) GetS3StorageByUUID

func (q *Queries) GetS3StorageByUUID(ctx context.Context, arg GetS3StorageByUUIDParams) (S3Storage, error)

func (*Queries) GetScheduledTaskByID

func (q *Queries) GetScheduledTaskByID(ctx context.Context, id int64) (GetScheduledTaskByIDRow, error)

func (*Queries) GetScheduledTaskByUUID

func (q *Queries) GetScheduledTaskByUUID(ctx context.Context, arg GetScheduledTaskByUUIDParams) (GetScheduledTaskByUUIDRow, error)

func (*Queries) GetScimMember

func (q *Queries) GetScimMember(ctx context.Context, arg GetScimMemberParams) (GetScimMemberRow, error)

A team member by user UUID (the SCIM resource id), with the internal user id needed to revoke sessions on deprovision.

func (*Queries) GetScimTokenByHash

func (q *Queries) GetScimTokenByHash(ctx context.Context, tokenHash string) (GetScimTokenByHashRow, error)

Resolves a bearer SCIM token to its team; unrevoked only.

func (*Queries) GetServerByID

func (q *Queries) GetServerByID(ctx context.Context, id int64) (Server, error)

func (*Queries) GetServerByUUID

func (q *Queries) GetServerByUUID(ctx context.Context, arg GetServerByUUIDParams) (Server, error)

func (*Queries) GetServiceByID

func (q *Queries) GetServiceByID(ctx context.Context, id int64) (Service, error)

func (*Queries) GetServiceComponentByUUID

func (q *Queries) GetServiceComponentByUUID(ctx context.Context, arg GetServiceComponentByUUIDParams) (ServiceComponent, error)

func (*Queries) GetServiceStackByUUID

func (q *Queries) GetServiceStackByUUID(ctx context.Context, arg GetServiceStackByUUIDParams) (GetServiceStackByUUIDRow, error)

Full stack lookup (mirror of GetApplicationByUUID): the resource, the compose extension, and the placement identities the API renders.

func (*Queries) GetSessionByTokenHash

func (q *Queries) GetSessionByTokenHash(ctx context.Context, tokenHash string) (GetSessionByTokenHashRow, error)

A session is only valid while it is unrevoked AND unexpired: both are checked in SQL so no caller can forget one of them.

func (*Queries) GetSharedVariableByUUID

func (q *Queries) GetSharedVariableByUUID(ctx context.Context, arg GetSharedVariableByUUIDParams) (SharedVariable, error)

func (*Queries) GetSleepingPreviewForServer

func (q *Queries) GetSleepingPreviewForServer(ctx context.Context, arg GetSleepingPreviewForServerParams) (Preview, error)

Agent ingestion ownership check (ADR-040): resolve a SLEEPING preview by uuid only when it lives on the given server — an agent token can never touch another server's state.

func (*Queries) GetStorageByUUID

func (q *Queries) GetStorageByUUID(ctx context.Context, arg GetStorageByUUIDParams) (PersistentStorage, error)

func (*Queries) GetTeamByID

func (q *Queries) GetTeamByID(ctx context.Context, id int64) (Team, error)

Teams (§10.1). Cursor pagination follows ERD §12: (team_id, id DESC) ordering, opaque cursor carrying the last seen internal id.

func (*Queries) GetTeamByUUID

func (q *Queries) GetTeamByUUID(ctx context.Context, uuid pgtype.UUID) (Team, error)

func (*Queries) GetTeamMemberByExternalID

Idempotent match for a SCIM-provisioned member (the IdP's externalId).

func (*Queries) GetTeamMemberByUUID

func (q *Queries) GetTeamMemberByUUID(ctx context.Context, arg GetTeamMemberByUUIDParams) (GetTeamMemberByUUIDRow, error)

Member role management (ADR-038).

func (*Queries) GetTeamMembershipForUser

The team a session acts in, with its role and public UUID (the dashboard addresses team endpoints by UUID). Falls back to the personal team. Carries the user's instance-root flag (users.is_root) so the session identity can gate instance-wide settings (rbac-matrix §3.5). A custom role (custom_role_id), when set, OVERRIDES the system role: its granular permissions are carried back for the session identity (ADR-038).

`preferred_team_id` is the team the session asked to act in (its current_team_id, or the user's remembered last_team_id at login). It is a PREFERENCE, not a filter: the row comes back only if the user really holds a membership in that team, so a session pinned to a team the user was removed from silently falls back to their oldest one instead of keeping an access nobody granted any more (INV-001). Pass 0 for "no preference".

Soft-deleted teams are excluded: a deleted team must stop being a place one can act in, whatever a stale session row still points at.

func (*Queries) GetTerminalSessionEndReason

func (q *Queries) GetTerminalSessionEndReason(ctx context.Context, id int64) (*TerminalEndReason, error)

The second half of the beat above, and the ONLY caller: read once, when the heartbeat matched zero rows, so the socket can report the word its session actually ended with instead of guessing one. It is never on the beat's common path — a session reaches this statement at most once, on the beat that discovers it is over — which is why the liveness update stays a single statement rather than growing a RETURNING and a join for the case that happens once.

NULL is a real answer and not an error: the row is still open, which is the generation case (another attach superseded this one) rather than the finalized one. The caller falls back to `disconnect` there, deliberately.

func (*Queries) GetTokenCreatorAuthority

What a token's creator holds in the token's team, re-read on every request (rbac-matrix §4.2). A token never grants more than its creator, so this is the ceiling its own scopes are intersected with — and it is why a demoted creator narrows their tokens without anyone revoking anything.

No row means the creator is no longer a member of that team: the token then holds nothing, which is the convergence the rule exists for.

func (*Queries) GetUptimeCheckByUUID

func (q *Queries) GetUptimeCheckByUUID(ctx context.Context, arg GetUptimeCheckByUUIDParams) (UptimeCheck, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

Browser sessions (PRD §698).

func (*Queries) GetUserByEmailIncludingDeleted

func (q *Queries) GetUserByEmailIncludingDeleted(ctx context.Context, email string) (User, error)

The collision check of §23.3 must also see soft-deleted accounts: a tombstoned email must not be resurrectable by whoever registers it at an identity provider.

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error)

func (*Queries) GetWebhookDeliveryByID

func (q *Queries) GetWebhookDeliveryByID(ctx context.Context, id int64) (WebhookDelivery, error)

func (*Queries) GetWebhookEndpointByUUID

func (q *Queries) GetWebhookEndpointByUUID(ctx context.Context, uuid pgtype.UUID) (GetWebhookEndpointByUUIDRow, error)

Resolution at reception: the endpoint carries everything needed to verify the signature and route the delivery.

func (*Queries) GetWebhookEndpointForApplication

func (q *Queries) GetWebhookEndpointForApplication(ctx context.Context, arg GetWebhookEndpointForApplicationParams) (WebhookEndpoint, error)

func (*Queries) HeartbeatJob

func (q *Queries) HeartbeatJob(ctx context.Context, arg HeartbeatJobParams) (int64, error)

func (*Queries) HeartbeatPortForwardSession

func (q *Queries) HeartbeatPortForwardSession(ctx context.Context, arg HeartbeatPortForwardSessionParams) (int64, error)

The WebSocket already pings every 20 s. Persisting one successful beat lets another replica, or the process that starts after a crash, reject a ghost.

Generation-aware since ADR-065 §5: the bridge already ends itself when this updates zero rows — "another replica or the scheduler finalized this" — and "another attach superseded me" is the same sentence. It is how supersession converges across replicas, within one beat, with no new mechanism.

func (*Queries) HeartbeatTerminalSession

func (q *Queries) HeartbeatTerminalSession(ctx context.Context, arg HeartbeatTerminalSessionParams) (int64, error)

The bridge already pings its peer every 20 s. Persisting one successful beat is what lets another replica, or the process that starts after a crash, tell a live shell from a ghost — and it is the statement ADR-067 §1 hangs the target's activity signal off, because a beat is the only moment an attached session talks to the control plane while a developer sits and reads.

Generation-aware exactly like the tunnel's (ADR-065 §5): zero rows updated is one sentence with three causes — the scheduler or another replica finalized this row, or another attach superseded this one — and one conclusion, that the socket must not outlive its own durable authorization.

func (*Queries) InsertAuditEvent

func (q *Queries) InsertAuditEvent(ctx context.Context, arg InsertAuditEventParams) error

Audit log (§23.4): strictly append-only — no UPDATE or single DELETE query must ever exist against this table.

func (*Queries) InsertInstanceSettingsIfAbsent

func (q *Queries) InsertInstanceSettingsIfAbsent(ctx context.Context, arg InsertInstanceSettingsIfAbsentParams) (int64, error)

func (*Queries) InsertOutboxEvent

func (q *Queries) InsertOutboxEvent(ctx context.Context, arg InsertOutboxEventParams) error

func (*Queries) IsJobCancelRequested

func (q *Queries) IsJobCancelRequested(ctx context.Context, id int64) (bool, error)

func (*Queries) KeepPreviewAlive

func (q *Queries) KeepPreviewAlive(ctx context.Context, id int64) error

/keep or the UI button: reset the inactivity clock and clear any pending expiry warning — the developer still needs this preview.

func (*Queries) LastSentDelivery

func (q *Queries) LastSentDelivery(ctx context.Context, ruleID int64) (pgtype.Timestamptz, error)

func (*Queries) ListAdoptionScansForServer

func (q *Queries) ListAdoptionScansForServer(ctx context.Context, arg ListAdoptionScansForServerParams) ([]AdoptionScan, error)

func (*Queries) ListApiTokensPage

func (q *Queries) ListApiTokensPage(ctx context.Context, arg ListApiTokensPageParams) ([]ListApiTokensPageRow, error)

API token management (§10.3). Token values are never stored nor returned: only the SHA-256 hash and the identification prefix. Two readings of the same list, told apart by created_by: the personal one ("my tokens", the caller's own) and the team-wide one an admin needs to see what exists. NULL means no filter — the team reading; a value means only that person's. The owner's email rides along so the team reading can say WHOSE a token is, which is the only thing that makes it actionable.

func (*Queries) ListAppArtifactsOnServer

func (q *Queries) ListAppArtifactsOnServer(ctx context.Context, arg ListAppArtifactsOnServerParams) ([]ListAppArtifactsOnServerRow, error)

Every local rollback image of the application (non-preview deployments) on one server, newest first — the caller keeps the N most recent and reclaims the rest (ADR-006 retention, §29.4). The live image is the newest here, so a retention >= 1 always protects it.

func (*Queries) ListApplicationIDsForRepositoryPush

func (q *Queries) ListApplicationIDsForRepositoryPush(ctx context.Context, arg ListApplicationIDsForRepositoryPushParams) ([]int64, error)

Fan-out of an app-level push webhook (protocols §2.4): every application bound to the pushed repository, matched by the provider-side repo ID — exact identity, never a URL comparison (INV-009, §23.5).

func (*Queries) ListApplicationsByTags

func (q *Queries) ListApplicationsByTags(ctx context.Context, arg ListApplicationsByTagsParams) ([]pgtype.UUID, error)

func (*Queries) ListApplicationsPage

func (q *Queries) ListApplicationsPage(ctx context.Context, arg ListApplicationsPageParams) ([]ListApplicationsPageRow, error)

func (*Queries) ListApplicationsToSleep

func (q *Queries) ListApplicationsToSleep(ctx context.Context) ([]ListApplicationsToSleepRow, error)

Awake applications that opted into scale-to-zero and are meant to run: the scheduler reads each one's waker activity file over SSH and sleeps the ones idle past their window (ADR-037). A manually stopped app (desired_status != running) is never touched. last_activity_at comes along for the same reason previews carry theirs: a signal the waker cannot produce (an attached port-forward) has to reach the sleep decision, and updated_at only moves on a deploy or a config change.

func (*Queries) ListAppliedProxyRevisions

func (q *Queries) ListAppliedProxyRevisions(ctx context.Context, serverID int64) ([]ProxyConfigRevision, error)

The current expected state of each scope on a server: its last applied revision (drift reconciliation, §6.2.4).

func (*Queries) ListAuditEventsPage

func (q *Queries) ListAuditEventsPage(ctx context.Context, arg ListAuditEventsPageParams) ([]AuditEvent, error)

Read side of the audit trail (§23.4: paginé, filtrable, exportable). A SELECT does not violate the append-only rule. Team-scoped; optional filters on action, result, actor, target and an occurred_at window; cursor by descending id.

func (*Queries) ListBackupExecutionsPage

func (q *Queries) ListBackupExecutionsPage(ctx context.Context, arg ListBackupExecutionsPageParams) ([]BackupExecution, error)

func (*Queries) ListBackupPlansForComponent

func (q *Queries) ListBackupPlansForComponent(ctx context.Context, serviceComponentID *int64) ([]DatabaseBackupPlan, error)

func (*Queries) ListBackupPlansForDatabase

func (q *Queries) ListBackupPlansForDatabase(ctx context.Context, databaseID *int64) ([]DatabaseBackupPlan, error)

func (*Queries) ListCancellablePreviewDeploymentIDs

func (q *Queries) ListCancellablePreviewDeploymentIDs(ctx context.Context, arg ListCancellablePreviewDeploymentIDsParams) ([]int64, error)

The build phases only: switching/finishing are past the point of no return, and terminal states have nothing to cancel.

func (*Queries) ListCertificatesForServer

func (q *Queries) ListCertificatesForServer(ctx context.Context, arg ListCertificatesForServerParams) ([]Certificate, error)

func (*Queries) ListCertificatesToAlert

func (q *Queries) ListCertificatesToAlert(ctx context.Context, thresholdDays int32) ([]ListCertificatesToAlertRow, error)

Certificates entering a threshold they have not been announced for yet (§4.3). A certificate already alerted at J-30 stays silent until it crosses J-7 — the alert fires on the transition, not on every pass.

func (*Queries) ListCleanupSchedulableServers

func (q *Queries) ListCleanupSchedulableServers(ctx context.Context) ([]Server, error)

Cleanup-enabled, ready servers (§3.7). The scheduler owns the cron window (cleanup_next_run_at) exactly like the backup plans.

func (*Queries) ListCustomRolesPage

func (q *Queries) ListCustomRolesPage(ctx context.Context, arg ListCustomRolesPageParams) ([]CustomRole, error)

func (*Queries) ListDNSCredentialsPage

func (q *Queries) ListDNSCredentialsPage(ctx context.Context, arg ListDNSCredentialsPageParams) ([]CloudCredential, error)

func (*Queries) ListDatabasesPage

func (q *Queries) ListDatabasesPage(ctx context.Context, arg ListDatabasesPageParams) ([]ListDatabasesPageRow, error)

func (*Queries) ListDeploymentSteps

func (q *Queries) ListDeploymentSteps(ctx context.Context, deploymentID int64) ([]DeploymentStep, error)

func (*Queries) ListDeploymentsForResource

func (q *Queries) ListDeploymentsForResource(ctx context.Context, arg ListDeploymentsForResourceParams) ([]ListDeploymentsForResourceRow, error)

The preview's PR number (NULL for a production deployment) rides along so the UI can say "preview #N" instead of a bare "preview".

func (*Queries) ListDigestRulesDue

func (q *Queries) ListDigestRulesDue(ctx context.Context) ([]ListDigestRulesDueRow, error)

--- deferred digest (ADR-019 §4) -------------------------------------------- Digest rules whose window has elapsed and that have something to say. A rule with nothing pending is not woken up: an empty digest is noise.

func (*Queries) ListDomainsForApplication

func (q *Queries) ListDomainsForApplication(ctx context.Context, applicationID *int64) ([]Domain, error)

func (*Queries) ListDrillablePlans

func (q *Queries) ListDrillablePlans(ctx context.Context) ([]ListDrillablePlansRow, error)

Enabled plans whose drill window has elapsed — managed databases AND stack components. A plan that has never been drilled (last_drill_at IS NULL) is due immediately: the first drill is the one that tells you whether the backups were ever any good.

func (*Queries) ListDueUptimeChecks

func (q *Queries) ListDueUptimeChecks(ctx context.Context) ([]UptimeCheck, error)

The prober's work list: enabled checks whose window has passed (or was never seeded). Owned by the scheduler leader — no extra locking needed.

func (*Queries) ListEnabledOauthProviderConfigs

func (q *Queries) ListEnabledOauthProviderConfigs(ctx context.Context) ([]ListEnabledOauthProviderConfigsRow, error)

What the sign-in page shows: enabled providers only, and nothing secret.

func (*Queries) ListEncryptedColumns

func (q *Queries) ListEncryptedColumns(ctx context.Context) ([]byte, error)

Envelope-encryption inventory (ADR-003, data-dictionary §12). The first 4 bytes of every *_enc column carry the key version that encrypted it.

Nothing here names a table. The inventory is derived from the schema by `encryption_inventory()` (migration 00093) and everything below reads it, so a new *_enc column is rotated and observed without touching this file. A hand-kept list is what let the histogram report a converged rotation while 16 columns still held the old key. The inventory itself: [{"tbl","col"}, ...] over every encrypted column of the schema. Drives the rotation loop, so what gets rewritten IS what exists.

func (*Queries) ListEnvVarsForDeploy

func (q *Queries) ListEnvVarsForDeploy(ctx context.Context, resourceID int64) ([]EnvironmentVariable, error)

func (*Queries) ListEnvVarsPage

func (q *Queries) ListEnvVarsPage(ctx context.Context, arg ListEnvVarsPageParams) ([]EnvironmentVariable, error)

The production set by default; the dedicated preview set on demand (§5.6): the platform-generated preview credentials live there, and an operator who cannot read them cannot open their own protected preview.

func (*Queries) ListEnvironmentsPage

func (q *Queries) ListEnvironmentsPage(ctx context.Context, arg ListEnvironmentsPageParams) ([]Environment, error)

func (*Queries) ListEnvironmentsSummary

func (q *Queries) ListEnvironmentsSummary(ctx context.Context, projectID int64) ([]Environment, error)

func (*Queries) ListExpiredLocalBackups

func (q *Queries) ListExpiredLocalBackups(ctx context.Context, arg ListExpiredLocalBackupsParams) ([]ListExpiredLocalBackupsRow, error)

Retention (§7.2): the count and age rules are cumulative — a backup expires if it falls outside EITHER — and 0 means unlimited. The last successful backup of a plan is never dropped, whatever the rules say.

func (*Queries) ListExpiredPreviews

func (q *Queries) ListExpiredPreviews(ctx context.Context) ([]Preview, error)

TTL of inactivity (§20.4.3): based on the last deployment or activity.

func (*Queries) ListExpiredS3Backups

func (q *Queries) ListExpiredS3Backups(ctx context.Context, arg ListExpiredS3BackupsParams) ([]ListExpiredS3BackupsRow, error)

Same rules, applied to the objects in the bucket. A backup can outlive its local copy in S3, or the reverse — the two retentions are independent.

func (*Queries) ListExternalEndpointGrantsPage

Newest first: the audit question is almost always "who has access right now", so the cursor walks ids downwards.

func (*Queries) ListExternalEndpointsPage

func (q *Queries) ListExternalEndpointsPage(ctx context.Context, arg ListExternalEndpointsPageParams) ([]ExternalEndpoint, error)

func (*Queries) ListGithubAppsPage

func (q *Queries) ListGithubAppsPage(ctx context.Context, arg ListGithubAppsPageParams) ([]GithubApp, error)

func (*Queries) ListIdentitiesForUser

func (q *Queries) ListIdentitiesForUser(ctx context.Context, userID int64) ([]Identity, error)

func (*Queries) ListIngressEndpoints

func (q *Queries) ListIngressEndpoints(ctx context.Context, teamID int64) ([]ListIngressEndpointsRow, error)

func (*Queries) ListIngressSessionsPage

func (q *Queries) ListIngressSessionsPage(ctx context.Context, arg ListIngressSessionsPageParams) ([]ListIngressSessionsPageRow, error)

func (*Queries) ListInstanceAuditEventsPage

func (q *Queries) ListInstanceAuditEventsPage(ctx context.Context, arg ListInstanceAuditEventsPageParams) ([]AuditEvent, error)

Instance-wide audit (reserved to the instance root): every team AND the system/instance actions that have no team_id (encryption rotation, instance settings…), which no team-scoped view can show. Same optional filters.

func (*Queries) ListInvitationsPage

func (q *Queries) ListInvitationsPage(ctx context.Context, arg ListInvitationsPageParams) ([]ListInvitationsPageRow, error)

func (*Queries) ListJobsPage

func (q *Queries) ListJobsPage(ctx context.Context, arg ListJobsPageParams) ([]Job, error)

func (*Queries) ListLivePortForwardSessionsByGrant

func (q *Queries) ListLivePortForwardSessionsByGrant(ctx context.Context, grantID *int64) ([]PortForwardSession, error)

Revoking a grant tears down the sessions it opened; this is that set.

func (*Queries) ListLivePreviewUUIDs

func (q *Queries) ListLivePreviewUUIDs(ctx context.Context, uuids []pgtype.UUID) ([]pgtype.UUID, error)

Network-prune exclusion (§3.7): a sleeping scale-to-zero preview's stack network looks unused to Docker (stopped containers hold no endpoints), but pruning it breaks the wake — only networks whose preview is DESTROYED are orphans.

func (*Queries) ListLiveResourceUUIDs

func (q *Queries) ListLiveResourceUUIDs(ctx context.Context, uuids []pgtype.UUID) ([]pgtype.UUID, error)

Scan exclusion (INV-015): "managed" means tracked by a live row, not just labelled — a disowned resource keeps its labels but is adoptable again.

func (*Queries) ListMcpAccessTokensForTeam

func (q *Queries) ListMcpAccessTokensForTeam(ctx context.Context, teamID int64) ([]McpAccessToken, error)

func (*Queries) ListNotificationChannelsPage

func (q *Queries) ListNotificationChannelsPage(ctx context.Context, arg ListNotificationChannelsPageParams) ([]NotificationChannel, error)

Notifications (§11, ADR-019).

func (*Queries) ListNotificationRules

func (q *Queries) ListNotificationRules(ctx context.Context, channelID int64) ([]NotificationRule, error)

func (*Queries) ListOauthProviderConfigs

func (q *Queries) ListOauthProviderConfigs(ctx context.Context) ([]OauthProviderConfig, error)

OAuth/OIDC dashboard login (PRD §10.2, §23.3): provider credentials, in-flight login states, and the identities an account is linked to.

func (*Queries) ListOutboxEventsAfter

func (q *Queries) ListOutboxEventsAfter(ctx context.Context, arg ListOutboxEventsAfterParams) ([]OutboxEvent, error)

Every event, whatever its team: the rules decide who hears about it.

func (*Queries) ListOutboxEventsForTeamAfter

func (q *Queries) ListOutboxEventsForTeamAfter(ctx context.Context, arg ListOutboxEventsForTeamAfterParams) ([]OutboxEvent, error)

func (*Queries) ListPasskeysForUser

func (q *Queries) ListPasskeysForUser(ctx context.Context, userID int64) ([]PasskeyCredential, error)

func (*Queries) ListPendingDigestDeliveries

func (q *Queries) ListPendingDigestDeliveries(ctx context.Context, ruleID int64) ([]ListPendingDigestDeliveriesRow, error)

What the digest of this rule stands for.

func (*Queries) ListPendingInvitationsByEmail

func (q *Queries) ListPendingInvitationsByEmail(ctx context.Context, email string) ([]ListPendingInvitationsByEmailRow, error)

Every still-pending invitation issued to an email. Used by the OAuth/SSO signup path: an invitation authorizes account creation even when open registration is off — the admin who issued it vouched for this exact address.

func (*Queries) ListPortForwardSessionsPage

func (q *Queries) ListPortForwardSessionsPage(ctx context.Context, arg ListPortForwardSessionsPageParams) ([]ListPortForwardSessionsPageRow, error)

The operator's view of the team's tunnels. Newest first, like the grant list: the question asked is almost always "what is forwarded right now". The joins are LEFT because a session outlives its user and its endpoint — a row whose target was deleted still has to be readable, or the audit trail has holes exactly where something was removed.

func (*Queries) ListPreviewArtifactsOnServer

func (q *Queries) ListPreviewArtifactsOnServer(ctx context.Context, arg ListPreviewArtifactsOnServerParams) ([]ListPreviewArtifactsOnServerRow, error)

Same, scoped to one preview: its images live under akerdock/<preview_uuid>, a namespace distinct from production (deployment engine §5.7).

func (*Queries) ListPreviewEnvVars

func (q *Queries) ListPreviewEnvVars(ctx context.Context, arg ListPreviewEnvVarsParams) ([]EnvironmentVariable, error)

The DEDICATED preview variable set (INV-010): production secrets are never copied implicitly. Per-PR overrides sit on top: a row carrying THIS preview's id wins over the shared set's same key.

func (*Queries) ListPreviewsForApplication

func (q *Queries) ListPreviewsForApplication(ctx context.Context, applicationID int64) ([]Preview, error)

func (*Queries) ListPreviewsForScaleToZero

func (q *Queries) ListPreviewsForScaleToZero(ctx context.Context) ([]ListPreviewsForScaleToZeroRow, error)

Scale-to-zero (ADR-036): active previews whose application opted in, with the app's idle window. The scheduler reads each preview's waker activity file over SSH and sleeps the ones idle past their window.

func (*Queries) ListPreviewsToWarn

func (q *Queries) ListPreviewsToWarn(ctx context.Context) ([]Preview, error)

Active previews at least 80% into their inactivity TTL and not yet warned — the heads-up window before ListExpiredPreviews reaps them.

func (*Queries) ListPrivateKeyIDsInUse

func (q *Queries) ListPrivateKeyIDsInUse(ctx context.Context, keyIds []int64) ([]int64, error)

Which of these keys are actually referenced — by a server or as an application's deploy key. Answered in one round trip so a key listing does not fan out into one query per row.

func (*Queries) ListPrivateKeysPage

func (q *Queries) ListPrivateKeysPage(ctx context.Context, arg ListPrivateKeysPageParams) ([]PrivateKey, error)

func (*Queries) ListProjectsPage

func (q *Queries) ListProjectsPage(ctx context.Context, arg ListProjectsPageParams) ([]Project, error)

func (*Queries) ListQueuedPreviews

func (q *Queries) ListQueuedPreviews(ctx context.Context) ([]Preview, error)

Promoted by the scheduler when capacity frees up (§20.4.3).

func (*Queries) ListReadyBuildServers

func (q *Queries) ListReadyBuildServers(ctx context.Context, teamID int64) ([]Server, error)

The build servers of a team that can actually take a build. A build server that is not ready is not a build server: dispatching to it would fail the deployment for a reason that has nothing to do with the application.

func (*Queries) ListReadyServers

func (q *Queries) ListReadyServers(ctx context.Context) ([]Server, error)

Every server the agent must run on (ADR-052): Docker operations flow through the command channel, so the helper is ensured on ALL ready servers — build servers and database-only hosts included, proxy or not.

func (*Queries) ListRegistryCredentialsPage

func (q *Queries) ListRegistryCredentialsPage(ctx context.Context, arg ListRegistryCredentialsPageParams) ([]RegistryCredential, error)

func (*Queries) ListRepositoriesForSource

func (q *Queries) ListRepositoriesForSource(ctx context.Context, gitSourceID int64) ([]Repository, error)

func (*Queries) ListRestoreDrillsPage

func (q *Queries) ListRestoreDrillsPage(ctx context.Context, arg ListRestoreDrillsPageParams) ([]ListRestoreDrillsPageRow, error)

func (*Queries) ListS3StoragesPage

func (q *Queries) ListS3StoragesPage(ctx context.Context, arg ListS3StoragesPageParams) ([]S3Storage, error)

S3 storages (§7.2, data-dictionary §6.6). Credentials are envelope-encrypted and never leave the instance (INV-003).

func (*Queries) ListSchedulableBackupPlans

func (q *Queries) ListSchedulableBackupPlans(ctx context.Context) ([]ListSchedulableBackupPlansRow, error)

Enabled plans of non-deleted targets — managed databases AND stack components (compose-spec §10). The scheduler owns the cron: it seeds next_run_at when it is NULL and fires the plans that are due. target_resource_id is the stack resource for a component plan: it is what jobs and events hang off.

func (*Queries) ListSchedulableTasks

func (q *Queries) ListSchedulableTasks(ctx context.Context) ([]ListSchedulableTasksRow, error)

Every enabled task of a live resource. The scheduler decides what is due: a task whose next_run_at is NULL has never been scheduled and must be seeded, so it cannot be filtered out here.

func (*Queries) ListScheduledTasksPage

func (q *Queries) ListScheduledTasksPage(ctx context.Context, arg ListScheduledTasksPageParams) ([]ListScheduledTasksPageRow, error)

func (*Queries) ListScimTokensPage

func (q *Queries) ListScimTokensPage(ctx context.Context, teamID int64) ([]ScimToken, error)

func (*Queries) ListServerDomains

func (q *Queries) ListServerDomains(ctx context.Context, serverID int64) ([]ListServerDomainsRow, error)

func (*Queries) ListServerResourcesPage

func (q *Queries) ListServerResourcesPage(ctx context.Context, arg ListServerResourcesPageParams) ([]ListServerResourcesPageRow, error)

Server inventory (§3): only managed resources appear here (INV-015).

func (*Queries) ListServersPage

func (q *Queries) ListServersPage(ctx context.Context, arg ListServersPageParams) ([]Server, error)

func (*Queries) ListServersWithProxy

func (q *Queries) ListServersWithProxy(ctx context.Context) ([]Server, error)

Servers whose routing the reconciler converges. A proxy the operator DELIBERATELY stopped (§3) is excluded: re-applying its files would be harmless, but the drift loop exists to repair accidents — and an intent is not an accident.

func (*Queries) ListServiceComponentDomains

func (q *Queries) ListServiceComponentDomains(ctx context.Context, serviceComponentID *int64) ([]Domain, error)

func (*Queries) ListServiceComponents

func (q *Queries) ListServiceComponents(ctx context.Context, resourceID int64) ([]ServiceComponent, error)

func (*Queries) ListServiceStacksPage

func (q *Queries) ListServiceStacksPage(ctx context.Context, arg ListServiceStacksPageParams) ([]ListServiceStacksPageRow, error)

func (*Queries) ListSharedVariablesForResource

func (q *Queries) ListSharedVariablesForResource(ctx context.Context, resourceID int64) ([]SharedVariable, error)

Everything a deployment of this resource inherits (§5.4): the team's variables, the ones of its project and environment, and the server-scoped variables of its destination server.

func (*Queries) ListSharedVariablesPage

func (q *Queries) ListSharedVariablesPage(ctx context.Context, arg ListSharedVariablesPageParams) ([]SharedVariable, error)

func (*Queries) ListSleepingApplications

func (q *Queries) ListSleepingApplications(ctx context.Context) ([]ListSleepingApplicationsRow, error)

Applications currently asleep (ADR-037): the scheduler flips them back to awake when the waker has served them again (fresh activity after slept_at).

func (*Queries) ListSleepingPreviews

func (q *Queries) ListSleepingPreviews(ctx context.Context) ([]Preview, error)

Sleeping previews (ADR-036): the scheduler checks whether the waker has woken them (fresh activity) and flips their status back to active.

func (*Queries) ListStoragesForResource

func (q *Queries) ListStoragesForResource(ctx context.Context, resourceID int64) ([]PersistentStorage, error)

func (*Queries) ListTCPProxyPorts

func (q *Queries) ListTCPProxyPorts(ctx context.Context, serverID int64) ([]*int32, error)

Every public port routed through the proxy on a server. It is the set the static config must declare: Traefik cannot add a listener at runtime.

func (*Queries) ListTagsForResource

func (q *Queries) ListTagsForResource(ctx context.Context, resourceID int64) ([]string, error)

func (*Queries) ListTaskExecutionsPage

func (q *Queries) ListTaskExecutionsPage(ctx context.Context, arg ListTaskExecutionsPageParams) ([]TaskExecution, error)

func (*Queries) ListTeamMembersForScim

func (q *Queries) ListTeamMembersForScim(ctx context.Context, teamID int64) ([]ListTeamMembersForScimRow, error)

SCIM Users/Groups source: every member with its effective role (system role, or the custom role uuid when set) so groups (=roles) can be assembled in Go.

func (*Queries) ListTeamMembersPage

func (q *Queries) ListTeamMembersPage(ctx context.Context, arg ListTeamMembersPageParams) ([]ListTeamMembersPageRow, error)

func (*Queries) ListTeamMembershipsForUser

func (q *Queries) ListTeamMembershipsForUser(ctx context.Context, userID int64) ([]ListTeamMembershipsForUserRow, error)

Every team the user may act in — the source of the dashboard's team switcher. Deliberately NOT /teams (which lists the instance's teams for the root): the switcher must offer memberships only, or switching would become a way to enter a team nobody added you to.

func (*Queries) ListTeamsPage

func (q *Queries) ListTeamsPage(ctx context.Context, arg ListTeamsPageParams) ([]Team, error)

func (*Queries) ListUnvalidatedLocalhostServers

func (q *Queries) ListUnvalidatedLocalhostServers(ctx context.Context) ([]Server, error)

The seeded localhost server, while it has never passed a validation (instance-config §6.2): the scheduler retries it until the instance key is authorized on the host. Bounded to 24h after creation so a host that will never run SSH does not accumulate a failed job every tick forever — past the window, validation stays a click away in the UI.

func (*Queries) ListUptimeChecksPage

func (q *Queries) ListUptimeChecksPage(ctx context.Context, arg ListUptimeChecksPageParams) ([]UptimeCheck, error)

func (*Queries) ListUptimeResultsPage

func (q *Queries) ListUptimeResultsPage(ctx context.Context, arg ListUptimeResultsPageParams) ([]UptimeCheckResult, error)

func (*Queries) MarkBackupLocalDeleted

func (q *Queries) MarkBackupLocalDeleted(ctx context.Context, id int64) error

func (*Queries) MarkBackupS3Deleted

func (q *Queries) MarkBackupS3Deleted(ctx context.Context, id int64) error

func (*Queries) MarkCertificateAlerted

func (q *Queries) MarkCertificateAlerted(ctx context.Context, arg MarkCertificateAlertedParams) error

func (*Queries) MarkDigestDeliveriesFailed

func (q *Queries) MarkDigestDeliveriesFailed(ctx context.Context, arg MarkDigestDeliveriesFailedParams) error

func (*Queries) MarkDigestDeliveriesSent

func (q *Queries) MarkDigestDeliveriesSent(ctx context.Context, deliveryIds []int64) error

func (*Queries) MarkIngressSessionClaimed

func (q *Queries) MarkIngressSessionClaimed(ctx context.Context, uuid pgtype.UUID) (int64, error)

Stamped from the agent's claim observation, never from an HTTP redeem: the socket lives agent-side. Idempotent against replayed observations.

func (*Queries) MarkJobRunning

func (q *Queries) MarkJobRunning(ctx context.Context, arg MarkJobRunningParams) (int64, error)

func (*Queries) MarkPreviewDeployRequested

func (q *Queries) MarkPreviewDeployRequested(ctx context.Context, id int64) error

Records an explicit human deploy order (/deploy, /rebuild, the Previews tab, a fork approval): under the manual-first policy the capacity queue only promotes a queued preview once this is set (§20.4).

func (*Queries) MarkProxyRevisionApplied

func (q *Queries) MarkProxyRevisionApplied(ctx context.Context, id int64) error

func (*Queries) MarkProxyRevisionFailed

func (q *Queries) MarkProxyRevisionFailed(ctx context.Context, arg MarkProxyRevisionFailedParams) error

func (*Queries) MarkProxyRevisionRolledBack

func (q *Queries) MarkProxyRevisionRolledBack(ctx context.Context, id int64) error

func (*Queries) MarkTerminalSessionStreamed

func (q *Queries) MarkTerminalSessionStreamed(ctx context.Context, id int64) (int64, error)

Stamped once, when the session's single data stream joins — affordable only because a terminal has exactly one (ADR-065 §6). Read by the sweep alone: it is what tells an abandoned claim from a live shell, and it is deliberately not a re-claim condition.

func (*Queries) MatchNotificationRules

func (q *Queries) MatchNotificationRules(ctx context.Context, arg MatchNotificationRulesParams) ([]MatchNotificationRulesRow, error)

The rules that hear this event type, for this team, honouring the project/environment scoping (NULL = the whole team).

func (*Queries) MaxDeploymentStepSeq

func (q *Queries) MaxDeploymentStepSeq(ctx context.Context, deploymentID int64) (int32, error)

A resumed deployment continues the step numbering of the attempt that crashed: restarting at 1 would collide with the steps already recorded, and would also erase the history of what the dead worker had done.

func (*Queries) NextFreePublicPort

func (q *Queries) NextFreePublicPort(ctx context.Context, serverID int64) (int32, error)

Lowest free port in the dynamic range for a server (§6.2); the unique index remains the authority against concurrent allocation.

func (*Queries) PinServerHostKey

func (q *Queries) PinServerHostKey(ctx context.Context, arg PinServerHostKeyParams) error

Trust-on-first-use (§20.1): the fingerprint is written only when none is pinned yet. Overwriting it here would defeat the whole point — a changed key must fail the connection, not silently re-pin itself.

func (*Queries) PromoteWaitingJobs

func (q *Queries) PromoteWaitingJobs(ctx context.Context) (int64, error)

func (*Queries) PurgeAuditEvents

func (q *Queries) PurgeAuditEvents(ctx context.Context, retentionDays int32) (int64, error)

Retention purge (§23.4): removes audit rows older than retention_days. Goes through the SQL function (not a direct DELETE) — the function is the only sanctioned path past the append-only trigger, and it caps the deletion to aged-out rows. retention_days <= 0 keeps everything. Returns rows removed.

func (*Queries) PurgeCliAuthCodes

func (q *Queries) PurgeCliAuthCodes(ctx context.Context) (int64, error)

func (*Queries) PurgeExpiredMfaChallenges

func (q *Queries) PurgeExpiredMfaChallenges(ctx context.Context) (int64, error)

func (*Queries) PurgeExpiredOauthLoginStates

func (q *Queries) PurgeExpiredOauthLoginStates(ctx context.Context) (int64, error)

func (*Queries) PurgeExpiredPasskeyCeremonies

func (q *Queries) PurgeExpiredPasskeyCeremonies(ctx context.Context) (int64, error)

func (*Queries) PurgeExpiredSessions

func (q *Queries) PurgeExpiredSessions(ctx context.Context) (int64, error)

func (*Queries) PurgeIdempotencyKeys

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

func (*Queries) PurgeIngressSessions

func (q *Queries) PurgeIngressSessions(ctx context.Context) (int64, error)

func (*Queries) PurgePortForwardSessions

func (q *Queries) PurgePortForwardSessions(ctx context.Context, retentionDays int32) (int64, error)

func (*Queries) PurgePublishedOutboxEvents

func (q *Queries) PurgePublishedOutboxEvents(ctx context.Context) (int64, error)

Never purge past the notification cursor: an event the dispatcher has not read yet would be a notification silently lost (the 7-day window makes this unlikely, not impossible — a long outage is exactly when alerts matter).

func (*Queries) PurgeTerminalJobs

func (q *Queries) PurgeTerminalJobs(ctx context.Context, retentionDays int32) (int64, error)

Retention (§19.2, §22.2): terminal jobs are purged; dead_letter rows are kept until an operator retries or forgets them.

func (*Queries) PurgeTerminalSessions

func (q *Queries) PurgeTerminalSessions(ctx context.Context, retentionDays int32) (int64, error)

func (*Queries) PurgeUptimeResults

func (q *Queries) PurgeUptimeResults(ctx context.Context, retentionDays int32) (int64, error)

History retention (§19.2): raw probe results are bounded; the check row keeps the current verdict forever.

func (*Queries) PurgeWebhookDeliveries

func (q *Queries) PurgeWebhookDeliveries(ctx context.Context) (int64, error)

Retention bounds the dedup window: purging too aggressively would reopen the replay window (INV-009), hence 30 days minimum.

func (*Queries) ReapExpiredLeases

func (q *Queries) ReapExpiredLeases(ctx context.Context, maxResumes int32) ([]ReapExpiredLeasesRow, error)

Reaper (INV-013): expired leases go back to the queue via retry_wait, or to dead_letter when attempts are exhausted. Handlers must inspect the remote effect before redoing work (§21.3). A crashed worker is not a failed job (§2.5): the attempt is GIVEN BACK (attempt - 1) so a deployment with max_attempts = 1 can still be resumed — the resume inspects the remote state first, it never replays blindly. resume_count bounds it: a job that kills its worker every time is dead- lettered instead of looping forever.

func (*Queries) RecordApplicationActivity

func (q *Queries) RecordApplicationActivity(ctx context.Context, id int64) error

An attached port-forward is activity (ADR-032 with ADR-037): the tunnel goes straight to the container's IP over SSH, so the waker — which only records what the PROXY serves — never sees it, and the scheduler would stop the container the developer is connected to. Keyed on the resource id, which is the application's own id. A database or a compose stack targeted by a tunnel matches no row here, which is the intended no-op: neither has scale-to-zero.

func (*Queries) RecordFailedLogin

func (q *Queries) RecordFailedLogin(ctx context.Context, arg RecordFailedLoginParams) (RecordFailedLoginRow, error)

Counts the failure and locks the account past the threshold. Returns the row so the caller can tell "locked now" from "still open".

func (*Queries) RecordPreviewActivity

func (q *Queries) RecordPreviewActivity(ctx context.Context, id int64) error

A machine signal: an attached port-forward proves somebody is connected to this preview (ADR-032 with ADR-036), which the waker cannot see — it only records PROXIED HTTP, and a tunnel bypasses the proxy entirely.

Deliberately NOT KeepPreviewAlive. That one also clears expiry_warned_at, which records that a HUMAN asked to keep the preview; a heartbeat must not forge that consent. updated_at is left alone for a sharper reason: on a sleeping preview it carries the instant we slept it, and bumping it every 20 s would push the wake comparison out of reach forever.

func (*Queries) RecordServerFacts

func (q *Queries) RecordServerFacts(ctx context.Context, arg RecordServerFactsParams) error

func (*Queries) RecordUptimeResult

func (q *Queries) RecordUptimeResult(ctx context.Context, arg RecordUptimeResultParams) error

func (*Queries) RegisterMcpOauthClient

func (q *Queries) RegisterMcpOauthClient(ctx context.Context, arg RegisterMcpOauthClientParams) (McpOauthClient, error)

Built-in MCP server (ADR-043): OAuth 2.1 for remote clients. Everything here is read-only in effect — a grant only ever reads one team's inventory.

func (*Queries) RemoveTeamMemberByUUID

func (q *Queries) RemoveTeamMemberByUUID(ctx context.Context, arg RemoveTeamMemberByUUIDParams) (int64, error)

Deprovision: drop the membership (the account and its sessions are handled separately). Team-scoped by the member's user UUID.

func (*Queries) RepinServerHostKey

func (q *Queries) RepinServerHostKey(ctx context.Context, arg RepinServerHostKeyParams) error

Deliberate re-pin, on an explicit re-validation of a rebuilt server.

func (*Queries) ReplaceMfaRecoveryCodes

func (q *Queries) ReplaceMfaRecoveryCodes(ctx context.Context, arg ReplaceMfaRecoveryCodesParams) (int64, error)

func (*Queries) RequestDeploymentJobCancel

func (q *Queries) RequestDeploymentJobCancel(ctx context.Context, deploymentID int64) (int64, error)

Cooperative cancellation (§2.6): the worker checks the flag at each checkpoint between steps, before the switching barrier (§21.1).

func (*Queries) ResolveAuditTargetName

func (q *Queries) ResolveAuditTargetName(ctx context.Context, arg ResolveAuditTargetNameParams) (string, error)

The display name of what an action touched, read at the moment it is audited so the trail keeps the name the resource had THEN (see 00084).

One statement rather than fifteen: each branch is gated by the target kind, so PostgreSQL discards the others on a constant one-time filter and only the matching table is probed, by its unique index on uuid. Best-effort by construction — an unknown kind or a row already gone simply yields nothing, and the trail keeps the uuid it already has.

func (*Queries) ResolveProjectEnvironmentOfResource

func (q *Queries) ResolveProjectEnvironmentOfResource(ctx context.Context, uuid pgtype.UUID) (ResolveProjectEnvironmentOfResourceRow, error)

Which project/environment a resource belongs to, for rule scoping.

func (*Queries) RevokeAllSessionsOfUser

func (q *Queries) RevokeAllSessionsOfUser(ctx context.Context, userID int64) (int64, error)

Used on logout-everywhere and on any credential change: a password reset that leaves old sessions alive has reset nothing.

func (*Queries) RevokeApiTokenByUUID

func (q *Queries) RevokeApiTokenByUUID(ctx context.Context, arg RevokeApiTokenByUUIDParams) (int64, error)

func (*Queries) RevokeApiTokensForUserInTeam

func (q *Queries) RevokeApiTokensForUserInTeam(ctx context.Context, arg RevokeApiTokensForUserInTeamParams) (int64, error)

Deprovision: revoke every API token the user holds in this team.

func (*Queries) RevokeExternalEndpointGrant

func (q *Queries) RevokeExternalEndpointGrant(ctx context.Context, arg RevokeExternalEndpointGrantParams) (ExternalEndpointGrant, error)

func (*Queries) RevokeInvitation

func (q *Queries) RevokeInvitation(ctx context.Context, arg RevokeInvitationParams) (int64, error)

func (*Queries) RevokeMcpAccessToken

func (q *Queries) RevokeMcpAccessToken(ctx context.Context, arg RevokeMcpAccessTokenParams) (int64, error)

func (*Queries) RevokeScimToken

func (q *Queries) RevokeScimToken(ctx context.Context, arg RevokeScimTokenParams) (int64, error)

func (*Queries) RevokeSession

func (q *Queries) RevokeSession(ctx context.Context, id int64) error

func (*Queries) RotateInvitation

func (q *Queries) RotateInvitation(ctx context.Context, arg RotateInvitationParams) (Invitation, error)

Regenerate the link of a still-pending invitation: rotate the token hash and push the expiry out. Returns nothing if the invitation is not pending.

func (*Queries) SetAcmeEmailIfAbsent

func (q *Queries) SetAcmeEmailIfAbsent(ctx context.Context, acmeEmail *string) (int64, error)

Seeds the ACME contact on an instance that predates the setting. The database stays authoritative: an existing value is never overwritten by the variable.

func (*Queries) SetAdoptionScanRunning

func (q *Queries) SetAdoptionScanRunning(ctx context.Context, id int64) error

func (*Queries) SetApiEnabled

func (q *Queries) SetApiEnabled(ctx context.Context, apiEnabled bool) (InstanceSetting, error)

Instance settings mutations (§14.2).

func (*Queries) SetApplicationAccessBasicAuth

func (q *Queries) SetApplicationAccessBasicAuth(ctx context.Context, arg SetApplicationAccessBasicAuthParams) error

func (*Queries) SetApplicationAccessProtection

func (q *Queries) SetApplicationAccessProtection(ctx context.Context, arg SetApplicationAccessProtectionParams) error

func (*Queries) SetApplicationAccessPublicRoutes

func (q *Queries) SetApplicationAccessPublicRoutes(ctx context.Context, arg SetApplicationAccessPublicRoutesParams) error

func (*Queries) SetApplicationAwake

func (q *Queries) SetApplicationAwake(ctx context.Context, id int64) error

func (*Queries) SetApplicationGitSource

func (q *Queries) SetApplicationGitSource(ctx context.Context, arg SetApplicationGitSourceParams) error

Links an application to a git source after creation — used when a provider API token arrives on an application whose public repository needed no source row until now (amendment 31).

func (*Queries) SetApplicationSlept

func (q *Queries) SetApplicationSlept(ctx context.Context, id int64) error

func (*Queries) SetBackupExecutionTableCount

func (q *Queries) SetBackupExecutionTableCount(ctx context.Context, arg SetBackupExecutionTableCountParams) error

Restore drills (ADR-014). A backup that has never been restored is a file, not a backup.

func (*Queries) SetBackupPlanSchedule

func (q *Queries) SetBackupPlanSchedule(ctx context.Context, arg SetBackupPlanScheduleParams) error

Advances the plan's cron window. Written by the scheduler only, so it does not bump `version` (it is not a user-visible edit and must not conflict with an optimistic-locking PATCH).

func (*Queries) SetCertificateStatus

func (q *Queries) SetCertificateStatus(ctx context.Context, arg SetCertificateStatusParams) error

func (*Queries) SetDeploymentCommit

func (q *Queries) SetDeploymentCommit(ctx context.Context, arg SetDeploymentCommitParams) error

func (*Queries) SetDeploymentCommitMeta

func (q *Queries) SetDeploymentCommitMeta(ctx context.Context, arg SetDeploymentCommitMetaParams) error

Author name and subject of the resolved commit, read on the build server after checkout — surfaces "who last pushed" in the deployment view. Best effort: a missing value leaves the column untouched.

func (*Queries) SetDeploymentError

func (q *Queries) SetDeploymentError(ctx context.Context, arg SetDeploymentErrorParams) error

func (*Queries) SetDeploymentImage

func (q *Queries) SetDeploymentImage(ctx context.Context, arg SetDeploymentImageParams) error

func (*Queries) SetDeploymentImageDigest

func (q *Queries) SetDeploymentImageDigest(ctx context.Context, arg SetDeploymentImageDigestParams) error

func (*Queries) SetDeploymentStatus

func (q *Queries) SetDeploymentStatus(ctx context.Context, arg SetDeploymentStatusParams) error

func (*Queries) SetDeploymentStepLog

func (q *Queries) SetDeploymentStepLog(ctx context.Context, arg SetDeploymentStepLogParams) error

Live output of a RUNNING step (docker build, container start): the SSE log stream polls the steps every second, so refreshing the log as the command runs is what turns "step build: started … (silence)" into a console.

func (*Queries) SetGitSourceAPIToken

func (q *Queries) SetGitSourceAPIToken(ctx context.Context, arg SetGitSourceAPITokenParams) error

Write-only provider API token (INV-003): stored envelope-encrypted, NULL removes it. Funds the degraded preview feedback and command rights checks (protocols §3-§6).

func (*Queries) SetGitSourceAPIURL

func (q *Queries) SetGitSourceAPIURL(ctx context.Context, arg SetGitSourceAPIURLParams) error

Self-hosted API endpoint (protocols §4.1/§6.1); NULL falls back to the derivation from the repository host.

func (*Queries) SetGithubAppInstallation

func (q *Queries) SetGithubAppInstallation(ctx context.Context, arg SetGithubAppInstallationParams) (int64, error)

First of the two redundant installation signals wins (§2.1 step 7).

func (*Queries) SetImageRetentionCount

func (q *Queries) SetImageRetentionCount(ctx context.Context, imageRetentionCount int32) (InstanceSetting, error)

Rollback image retention (ADR-006, §29.4). The CHECK (>= 1) keeps the live image protected even at the smallest setting.

func (*Queries) SetInstanceIdentity

func (q *Queries) SetInstanceIdentity(ctx context.Context, arg SetInstanceIdentityParams) (InstanceSetting, error)

FQDN + contact ACME (§14.2) : la base fait foi après le premier démarrage, c'est donc ici — et nulle part ailleurs — qu'ils se modifient.

func (*Queries) SetInstanceMcpDcrEnabled

func (q *Queries) SetInstanceMcpDcrEnabled(ctx context.Context, mcpDcrEnabled bool) error

func (*Queries) SetInstanceMcpEnabled

func (q *Queries) SetInstanceMcpEnabled(ctx context.Context, mcpEnabled bool) error

func (*Queries) SetLocalhostSeeded

func (q *Queries) SetLocalhostSeeded(ctx context.Context) (int64, error)

func (*Queries) SetMembershipExternalID

func (q *Queries) SetMembershipExternalID(ctx context.Context, arg SetMembershipExternalIDParams) error

func (*Queries) SetMfaRequired

func (q *Queries) SetMfaRequired(ctx context.Context, mfaRequired bool) (InstanceSetting, error)

func (*Queries) SetNotificationCursor

func (q *Queries) SetNotificationCursor(ctx context.Context, lastOutboxEventID int64) error

func (*Queries) SetOtlpConfig

func (q *Queries) SetOtlpConfig(ctx context.Context, otlpConfigEnc []byte) error

func (*Queries) SetPasswordLoginDisabled

func (q *Queries) SetPasswordLoginDisabled(ctx context.Context, passwordLoginDisabled bool) (InstanceSetting, error)

func (*Queries) SetPlanDrillResult

func (q *Queries) SetPlanDrillResult(ctx context.Context, arg SetPlanDrillResultParams) error

func (*Queries) SetPortForwardAuthorizedUntil

func (q *Queries) SetPortForwardAuthorizedUntil(ctx context.Context, arg SetPortForwardAuthorizedUntilParams) error

A renewed grant pushes back the deadline of the sessions it opened, so a transfer in flight survives instead of restarting from zero (ADR-045 §5).

func (*Queries) SetPreviewAwake

func (q *Queries) SetPreviewAwake(ctx context.Context, id int64) error

Back to the running state after a waker-driven wake; clears the expiry warning so an active preview is never mistaken for one about to be reaped.

func (*Queries) SetPreviewDeployed

func (q *Queries) SetPreviewDeployed(ctx context.Context, id int64) error

func (*Queries) SetPreviewExpiryWarned

func (q *Queries) SetPreviewExpiryWarned(ctx context.Context, id int64) error

func (*Queries) SetPreviewFqdn

func (q *Queries) SetPreviewFqdn(ctx context.Context, arg SetPreviewFqdnParams) error

func (*Queries) SetPreviewRandomSlug

func (q *Queries) SetPreviewRandomSlug(ctx context.Context, arg SetPreviewRandomSlugParams) error

Generated once at scaffolding; the stable value behind {{random}} (ADR-035).

func (*Queries) SetPreviewSleeping

func (q *Queries) SetPreviewSleeping(ctx context.Context, id int64) error

func (*Queries) SetPreviewStatus

func (q *Queries) SetPreviewStatus(ctx context.Context, arg SetPreviewStatusParams) error

func (*Queries) SetProxyDesiredState

func (q *Queries) SetProxyDesiredState(ctx context.Context, arg SetProxyDesiredStateParams) error

The operator's intent on the proxy (§3): an explicit stop must survive the drift reconciliation — a proxy someone deliberately stopped is not drift.

func (*Queries) SetProxyObservedStatus

func (q *Queries) SetProxyObservedStatus(ctx context.Context, arg SetProxyObservedStatusParams) error

func (*Queries) SetRegistrationEnabled

func (q *Queries) SetRegistrationEnabled(ctx context.Context, registrationEnabled bool) (InstanceSetting, error)

Open/close self-service signup (§10.2). Closed is the default; with SSO an invitation still authorizes account creation regardless of this flag.

func (*Queries) SetResourceAdoption

func (q *Queries) SetResourceAdoption(ctx context.Context, arg SetResourceAdoptionParams) error

Marks a resource as adopted and not yet normalized: the JSONB points at the real remote objects (container name, compose project).

func (*Queries) SetResourceDesiredStatus

func (q *Queries) SetResourceDesiredStatus(ctx context.Context, arg SetResourceDesiredStatusParams) error

func (*Queries) SetResourceObservedStatus

func (q *Queries) SetResourceObservedStatus(ctx context.Context, arg SetResourceObservedStatusParams) error

func (*Queries) SetResourceRemnants

func (q *Queries) SetResourceRemnants(ctx context.Context, arg SetResourceRemnantsParams) error

What a failed deletion left behind on the server (§20.6.4). Recorded so the operator can retry, or forget with an explicit acknowledgement — a forget never cleans anything up remotely, it only stops pretending the job matters.

func (*Queries) SetRuleDigestFlushed

func (q *Queries) SetRuleDigestFlushed(ctx context.Context, id int64) error

func (*Queries) SetS3StorageCheck

func (q *Queries) SetS3StorageCheck(ctx context.Context, arg SetS3StorageCheckParams) error

func (*Queries) SetScheduledTaskSchedule

func (q *Queries) SetScheduledTaskSchedule(ctx context.Context, arg SetScheduledTaskScheduleParams) error

func (*Queries) SetServerCA

func (q *Queries) SetServerCA(ctx context.Context, arg SetServerCAParams) error

func (*Queries) SetServerCleanupSchedule

func (q *Queries) SetServerCleanupSchedule(ctx context.Context, arg SetServerCleanupScheduleParams) error

Scheduler-owned: never bumps `version` (not a user edit).

func (*Queries) SetServerStatus

func (q *Queries) SetServerStatus(ctx context.Context, arg SetServerStatusParams) error

func (*Queries) SetServiceAccessBasicAuth

func (q *Queries) SetServiceAccessBasicAuth(ctx context.Context, arg SetServiceAccessBasicAuthParams) error

func (*Queries) SetServiceAccessProtection

func (q *Queries) SetServiceAccessProtection(ctx context.Context, arg SetServiceAccessProtectionParams) error

func (*Queries) SetServiceComponentObserved

func (q *Queries) SetServiceComponentObserved(ctx context.Context, arg SetServiceComponentObservedParams) error

func (*Queries) SetServiceComponentObservedByName

func (q *Queries) SetServiceComponentObservedByName(ctx context.Context, arg SetServiceComponentObservedByNameParams) (int64, error)

Agent ingestion (ADR-040): refresh a component's observed state from a pushed Docker event, scoped to the resource's server. No-op when the state is unchanged, so at-least-once delivery stays idempotent.

func (*Queries) SetServiceNoindex

func (q *Queries) SetServiceNoindex(ctx context.Context, arg SetServiceNoindexParams) error

func (*Queries) SetSessionCurrentTeam

func (q *Queries) SetSessionCurrentTeam(ctx context.Context, arg SetSessionCurrentTeamParams) (int64, error)

Moves a live session into another team (PRD §37). Revoked sessions are not matched: nothing may be done through a session that is already dead.

func (*Queries) SetSessionMfaVerified

func (q *Queries) SetSessionMfaVerified(ctx context.Context, id int64) error

Passkey step-up (rbac-matrix §5): stamps the browser session; freshness is judged by the caller against the step-up window.

func (*Queries) SetSessionTotpVerified

func (q *Queries) SetSessionTotpVerified(ctx context.Context, id int64) error

TOTP step-up (ADR-045 §5). Deliberately a SEPARATE column from the passkey marker: `mfa_verified_at` means "recent passkey", the root terminal requires that ritual, and letting a TOTP set it would hand every TOTP-only user a root shell.

func (*Queries) SetSessionViewAs

func (q *Queries) SetSessionViewAs(ctx context.Context, arg SetSessionViewAsParams) error

Enter or leave the role-inspection mode (ADR-058). Both arguments null = leave; the CHECK constraint keeps the two sources exclusive. Nothing here verifies authority: the caller does, against the session's REAL membership.

func (*Queries) SetTransactionalEmailConfig

func (q *Queries) SetTransactionalEmailConfig(ctx context.Context, transactionalEmailConfigEnc []byte) error

func (*Queries) SetUptimeCheckState

func (q *Queries) SetUptimeCheckState(ctx context.Context, arg SetUptimeCheckStateParams) error

The prober's state write: counters, verdict, and the next window. Never bumps `version` (not a user edit — it must not conflict with a PATCH).

func (*Queries) SetUserLastTeam

func (q *Queries) SetUserLastTeam(ctx context.Context, arg SetUserLastTeamParams) error

Remembers the team across sessions, so the next login opens where the user left off rather than on their oldest team.

func (*Queries) SoftDeleteBackupPlan

func (q *Queries) SoftDeleteBackupPlan(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteDNSCredential

func (q *Queries) SoftDeleteDNSCredential(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteEnvironment

func (q *Queries) SoftDeleteEnvironment(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteProject

func (q *Queries) SoftDeleteProject(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteProjectEnvironments

func (q *Queries) SoftDeleteProjectEnvironments(ctx context.Context, projectID int64) error

func (*Queries) SoftDeleteRegistryCredential

func (q *Queries) SoftDeleteRegistryCredential(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteResource

func (q *Queries) SoftDeleteResource(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteScheduledTask

func (q *Queries) SoftDeleteScheduledTask(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteServer

func (q *Queries) SoftDeleteServer(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteUptimeCheck

func (q *Queries) SoftDeleteUptimeCheck(ctx context.Context, id int64) (int64, error)

func (*Queries) StartDeploymentUnlessCleanupRunning

func (q *Queries) StartDeploymentUnlessCleanupRunning(ctx context.Context, deploymentID int64) (int64, error)

Atomic counterpart of CanStartServerCleanup. The first deployment transition and the cleanup guard serialize on the same server row. A cleanup is identified from the durable job itself, so a worker crash keeps deployments out until its lease is reaped; no in-memory mutex can provide that guarantee across replicas.

func (*Queries) SucceedJob

func (q *Queries) SucceedJob(ctx context.Context, arg SucceedJobParams) (int64, error)

func (*Queries) SupersedeObsoletePreviewDeployments

func (q *Queries) SupersedeObsoletePreviewDeployments(ctx context.Context, arg SupersedeObsoletePreviewDeploymentsParams) ([]int64, error)

§20.4.7 (opt-in preview_cancel_obsolete_builds): a new commit makes the in-flight preview build obsolete. Queued deployments flip here; running ones get a cooperative cancel (RequestDeploymentJobCancel) — never past the traffic switch (§21.1).

func (*Queries) SupersedeQueuedDeployments

func (q *Queries) SupersedeQueuedDeployments(ctx context.Context, arg SupersedeQueuedDeploymentsParams) ([]int64, error)

Coalescing (§3.4): a queued webhook deployment for the same application is superseded by a newer one; an already leased/running deployment is never coalesced.

func (*Queries) SweepIngressSessions

func (q *Queries) SweepIngressSessions(ctx context.Context) ([]IngressTunnelSession, error)

Leader-side finalization of rows whose socket can no longer answer for itself: an unclaimed token past its TTL, a claimed session whose agent went silent (no report for 90 s), or one past the 12 h ceiling (ADR-060 §6). The derived reason keeps the audit line and the CLI message coherent.

func (*Queries) SweepPortForwardSessions

func (q *Queries) SweepPortForwardSessions(ctx context.Context) ([]SweepPortForwardSessionsRow, error)

Finalize rows whose socket cannot still be alive. A non-NULL heartbeat names a bridge from this release or later; legacy NULL rows are left alone until the protocol's hard four-hour ceiling so an N-1 replica remains compatible.

func (*Queries) SweepTerminalSessions

func (q *Queries) SweepTerminalSessions(ctx context.Context, maxDurationSeconds int32) (int64, error)

Crash net: sessions live in-process, so a row left open past any possible lifetime is a control-plane restart, not a session. Unclaimed expired tokens are closed as revoked.

The third clause is what bounds ADR-065's abandoned attach. A client that vanished between the session request and its data stream now leaves the row claimed and re-claimable instead of ended, and this table has no heartbeat to age it: without this, that row would hold one of the twenty per-team slots until the max-duration ceiling. A claimed row that never carried its PTY is therefore closed once its token dies — the slot is held for at most the TTL plus one sweep interval — and as disconnect, which is what happened.

func (*Queries) TagResource

func (q *Queries) TagResource(ctx context.Context, arg TagResourceParams) error

func (*Queries) TakeMcpOauthCode

func (q *Queries) TakeMcpOauthCode(ctx context.Context, codeHash string) (McpOauthCode, error)

Consumes the code: a replay finds nothing (DELETE … RETURNING).

func (*Queries) TouchAgentTokenSeen

func (q *Queries) TouchAgentTokenSeen(ctx context.Context, id int64) error

func (*Queries) TouchApiTokenLastUsed

func (q *Queries) TouchApiTokenLastUsed(ctx context.Context, id int64) error

func (*Queries) TouchIngressSession

func (q *Queries) TouchIngressSession(ctx context.Context, uuid pgtype.UUID) (int64, error)

Agent-reported liveness. Zero rows means the durable session was finalized (operator close, sweep) and the caller must cut the socket.

func (*Queries) TouchMcpAccessToken

func (q *Queries) TouchMcpAccessToken(ctx context.Context, id int64) error

func (*Queries) TouchMfaFactorUsed

func (q *Queries) TouchMfaFactorUsed(ctx context.Context, arg TouchMfaFactorUsedParams) (int64, error)

The anti-replay gate (data-dictionary §4.3): last_used_at holds the start of the last accepted TOTP step, and only a strictly later step may pass. Enforced in SQL so two concurrent verifications of the same code cannot both win, whatever the callers do.

func (*Queries) TouchScimTokenUsed

func (q *Queries) TouchScimTokenUsed(ctx context.Context, id int64) error

func (*Queries) TouchSession

func (q *Queries) TouchSession(ctx context.Context, id int64) error

func (*Queries) UpdateApplicationGitSettings

func (q *Queries) UpdateApplicationGitSettings(ctx context.Context, arg UpdateApplicationGitSettingsParams) error

Git pipeline settings of a git application (PATCH /applications): a nil argument leaves the column alone — partial like the rest of the update. watch_paths carries a set flag because an explicit empty list must CLEAR the column ("deploy on every push again"), not keep it.

func (*Queries) UpdateApplicationPreviewSettings

func (q *Queries) UpdateApplicationPreviewSettings(ctx context.Context, arg UpdateApplicationPreviewSettingsParams) error

func (*Queries) UpdateApplicationScaleToZero

func (q *Queries) UpdateApplicationScaleToZero(ctx context.Context, arg UpdateApplicationScaleToZeroParams) error

Scale-to-zero of the application itself (ADR-037), separate from previews.

func (*Queries) UpdateBackupPlan

func (q *Queries) UpdateBackupPlan(ctx context.Context, arg UpdateBackupPlanParams) (int64, error)

func (*Queries) UpdateBuildConfigGitPipeline

func (q *Queries) UpdateBuildConfigGitPipeline(ctx context.Context, arg UpdateBuildConfigGitPipelineParams) error

Build-pack side of the same PATCH. publish_directory carries a set flag: an explicit null means "no publish step anymore", a COALESCE would keep it.

func (*Queries) UpdateBuildConfigSource

func (q *Queries) UpdateBuildConfigSource(ctx context.Context, arg UpdateBuildConfigSourceParams) error

func (*Queries) UpdateCustomRole

func (q *Queries) UpdateCustomRole(ctx context.Context, arg UpdateCustomRoleParams) (CustomRole, error)

Partial update: name/description/permissions. Permissions arrive already validated and closed under prerequisites by the handler.

func (*Queries) UpdateDatabasePassword

func (q *Queries) UpdateDatabasePassword(ctx context.Context, arg UpdateDatabasePasswordParams) error

func (*Queries) UpdateDatabaseRow

func (q *Queries) UpdateDatabaseRow(ctx context.Context, arg UpdateDatabaseRowParams) error

func (*Queries) UpdateEnvVar

func (q *Queries) UpdateEnvVar(ctx context.Context, arg UpdateEnvVarParams) (EnvironmentVariable, error)

func (*Queries) UpdateEnvironment

func (q *Queries) UpdateEnvironment(ctx context.Context, arg UpdateEnvironmentParams) (int64, error)

func (*Queries) UpdateExternalEndpoint

func (q *Queries) UpdateExternalEndpoint(ctx context.Context, arg UpdateExternalEndpointParams) (ExternalEndpoint, error)

func (*Queries) UpdateIngressEndpoint

func (q *Queries) UpdateIngressEndpoint(ctx context.Context, arg UpdateIngressEndpointParams) (IngressEndpoint, error)

The FQDN and the server are immutable after declaration: both are baked into the issued certificate and the deposited router. Renaming the URL is a delete + declare, which is what it costs everywhere else in the product.

func (*Queries) UpdateJobSteps

func (q *Queries) UpdateJobSteps(ctx context.Context, arg UpdateJobStepsParams) error

func (*Queries) UpdateNotificationChannel

func (q *Queries) UpdateNotificationChannel(ctx context.Context, arg UpdateNotificationChannelParams) (int64, error)

func (*Queries) UpdatePasskeyCredential

func (q *Queries) UpdatePasskeyCredential(ctx context.Context, arg UpdatePasskeyCredentialParams) error

Called after every successful assertion: the sign counter moved, and the clone-detection logic downstream depends on it being persisted.

func (*Queries) UpdatePrivateKey

func (q *Queries) UpdatePrivateKey(ctx context.Context, arg UpdatePrivateKeyParams) (int64, error)

func (*Queries) UpdateProject

func (q *Queries) UpdateProject(ctx context.Context, arg UpdateProjectParams) (int64, error)

func (*Queries) UpdateRegistryCredential

func (q *Queries) UpdateRegistryCredential(ctx context.Context, arg UpdateRegistryCredentialParams) (int64, error)

func (*Queries) UpdateResourceMeta

func (q *Queries) UpdateResourceMeta(ctx context.Context, arg UpdateResourceMetaParams) (int64, error)

func (*Queries) UpdateRuntimeSettings

func (q *Queries) UpdateRuntimeSettings(ctx context.Context, arg UpdateRuntimeSettingsParams) error

func (*Queries) UpdateS3Storage

func (q *Queries) UpdateS3Storage(ctx context.Context, arg UpdateS3StorageParams) (int64, error)

func (*Queries) UpdateScheduledTask

func (q *Queries) UpdateScheduledTask(ctx context.Context, arg UpdateScheduledTaskParams) (int64, error)

func (*Queries) UpdateServer

func (q *Queries) UpdateServer(ctx context.Context, arg UpdateServerParams) (int64, error)

func (*Queries) UpdateServiceCompose

func (q *Queries) UpdateServiceCompose(ctx context.Context, arg UpdateServiceComposeParams) (int64, error)

func (*Queries) UpdateSharedVariable

func (q *Queries) UpdateSharedVariable(ctx context.Context, arg UpdateSharedVariableParams) (int64, error)

func (*Queries) UpdateTeam

func (q *Queries) UpdateTeam(ctx context.Context, arg UpdateTeamParams) (Team, error)

Partial update of a team's name/description (§10.1).

func (*Queries) UpdateTeamMemberRole

func (q *Queries) UpdateTeamMemberRole(ctx context.Context, arg UpdateTeamMemberRoleParams) (int64, error)

Set a member's system role and (re)assign or clear its custom role. When custom_role_id is non-null it overrides the system role at resolution time; role is kept as the fallback. Team-scoped by the member's user UUID.

func (*Queries) UpdateUptimeCheck

func (q *Queries) UpdateUptimeCheck(ctx context.Context, arg UpdateUptimeCheckParams) (int64, error)

func (*Queries) UpsertCertificate

func (q *Queries) UpsertCertificate(ctx context.Context, arg UpsertCertificateParams) error

Certificates: observed reflection of the server state (§18.3).

func (*Queries) UpsertHealthCheck

func (q *Queries) UpsertHealthCheck(ctx context.Context, arg UpsertHealthCheckParams) (HealthCheck, error)

Health checks (§8.8): one row per resource, gate the rolling update.

func (*Queries) UpsertOauthProviderConfig

func (q *Queries) UpsertOauthProviderConfig(ctx context.Context, arg UpsertOauthProviderConfigParams) (OauthProviderConfig, error)

Full replacement, secret included: the API never reads the secret back, so there is nothing to "keep" on update — the caller re-provides it.

func (*Queries) UpsertPreview

func (q *Queries) UpsertPreview(ctx context.Context, arg UpsertPreviewParams) (Preview, error)

PR previews (data-dictionary §8.9, §20.4). New commit on the same PR reuses the identity — the instance redeploys, it is never duplicated (§20.4). A destroyed preview row is revived when the PR reopens.

func (*Queries) UpsertRepository

func (q *Queries) UpsertRepository(ctx context.Context, arg UpsertRepositoryParams) (Repository, error)

Discovery cache (§7.3): external_id is the identity — a rename updates full_name on the same row.

func (*Queries) UpsertServiceComponent

func (q *Queries) UpsertServiceComponent(ctx context.Context, arg UpsertServiceComponentParams) (ServiceComponent, error)

Component sync (data-dictionary §9.2): recreated/updated at every edit of the compose file. The upsert keeps the row identity (uuid, backup plans, domains) stable for components that survive the edit.

func (*Queries) UpsertTag

func (q *Queries) UpsertTag(ctx context.Context, arg UpsertTagParams) (Tag, error)

Tags (§5.4): used by the deploy webhook (?tag=).

func (*Queries) UpsertUnconfirmedMfaFactor

func (q *Queries) UpsertUnconfirmedMfaFactor(ctx context.Context, arg UpsertUnconfirmedMfaFactorParams) (MfaFactor, error)

Setup creates the factor, or replaces one that was never confirmed (the user scanned a QR code, closed the tab, started over). A CONFIRMED factor is never replaced this way — the WHERE arms the conflict update only for unconfirmed rows, so setup over an active factor returns no row and the caller answers 409. The uuid is generated by the caller: the envelope AAD binds the ciphertext to it before the insert.

func (*Queries) WakeSleptApplicationForServer

func (q *Queries) WakeSleptApplicationForServer(ctx context.Context, arg WakeSleptApplicationForServerParams) (int64, error)

Agent ingestion (ADR-040): flip a slept scale-to-zero application back to awake, only when its resource lives on the given server. Returns the resource id so the caller can emit the woken event; no row = nothing slept.

func (*Queries) WithTx

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

type ReapExpiredLeasesRow

type ReapExpiredLeasesRow struct {
	ID     int64
	Uuid   pgtype.UUID
	Status JobStatus
}

type RecordFailedLoginParams

type RecordFailedLoginParams struct {
	ID          int64
	MaxAttempts int32
	LockMinutes int32
}

type RecordFailedLoginRow

type RecordFailedLoginRow struct {
	FailedLoginCount int32
	LockedUntil      pgtype.Timestamptz
}

type RecordServerFactsParams

type RecordServerFactsParams struct {
	ID            int64
	OsName        *string
	Architecture  *string
	DockerVersion *string
	Status        ServerStatus
}

type RecordUptimeResultParams

type RecordUptimeResultParams struct {
	CheckID    int64
	Ok         bool
	LatencyMs  *int32
	StatusCode *int32
	Error      *string
}

type RedirectDirection

type RedirectDirection string
const (
	RedirectDirectionBoth   RedirectDirection = "both"
	RedirectDirectionWww    RedirectDirection = "www"
	RedirectDirectionNonWww RedirectDirection = "non_www"
)

func (*RedirectDirection) Scan

func (e *RedirectDirection) Scan(src interface{}) error

type RegisterMcpOauthClientParams

type RegisterMcpOauthClientParams struct {
	ClientID     string
	ClientName   string
	RedirectUris []string
}

type RegistryCredential

type RegistryCredential struct {
	ID          int64
	Uuid        pgtype.UUID
	TeamID      int64
	Name        string
	RegistryUrl string
	Username    string
	PasswordEnc []byte
	CreatedBy   *int64
	UpdatedBy   *int64
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	Version     int32
}

type RemoveTeamMemberByUUIDParams

type RemoveTeamMemberByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type RepinServerHostKeyParams

type RepinServerHostKeyParams struct {
	ID                 int64
	HostKeyFingerprint *string
}

type ReplaceMfaRecoveryCodesParams

type ReplaceMfaRecoveryCodesParams struct {
	UserID             int64
	RecoveryCodeHashes []string
}

type Repository

type Repository struct {
	ID            int64
	Uuid          pgtype.UUID
	GitSourceID   int64
	ExternalID    string
	FullName      string
	DefaultBranch *string
	HtmlUrl       *string
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
}

type ResolveAuditTargetNameParams

type ResolveAuditTargetNameParams struct {
	TargetUuid pgtype.UUID
	TargetKind string
}

type ResolveProjectEnvironmentOfResourceRow

type ResolveProjectEnvironmentOfResourceRow struct {
	EnvironmentID int64
	ProjectID     int64
}

type Resource

type Resource struct {
	ID             int64
	Uuid           pgtype.UUID
	TeamID         int64
	EnvironmentID  int64
	DestinationID  int64
	ResourceType   ResourceType
	Name           string
	Description    *string
	DesiredStatus  ResourceDesiredStatus
	ObservedStatus ResourceObservedStatus
	ObservedAt     pgtype.Timestamptz
	LastOnlineAt   pgtype.Timestamptz
	Remnants       []byte
	CreatedBy      *int64
	UpdatedBy      *int64
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
	Version        int32
	AdoptedAt      pgtype.Timestamptz
	Adoption       []byte
}

type ResourceDesiredStatus

type ResourceDesiredStatus string
const (
	ResourceDesiredStatusStopped  ResourceDesiredStatus = "stopped"
	ResourceDesiredStatusRunning  ResourceDesiredStatus = "running"
	ResourceDesiredStatusDeleting ResourceDesiredStatus = "deleting"
	ResourceDesiredStatusDeleted  ResourceDesiredStatus = "deleted"
)

func (*ResourceDesiredStatus) Scan

func (e *ResourceDesiredStatus) Scan(src interface{}) error

type ResourceObservedStatus

type ResourceObservedStatus string
const (
	ResourceObservedStatusUnknown   ResourceObservedStatus = "unknown"
	ResourceObservedStatusStarting  ResourceObservedStatus = "starting"
	ResourceObservedStatusHealthy   ResourceObservedStatus = "healthy"
	ResourceObservedStatusUnhealthy ResourceObservedStatus = "unhealthy"
	ResourceObservedStatusExited    ResourceObservedStatus = "exited"
	ResourceObservedStatusMissing   ResourceObservedStatus = "missing"
)

func (*ResourceObservedStatus) Scan

func (e *ResourceObservedStatus) Scan(src interface{}) error

type ResourceTag

type ResourceTag struct {
	ResourceID int64
	TagID      int64
	CreatedAt  pgtype.Timestamptz
}

type ResourceType

type ResourceType string
const (
	ResourceTypeApplication ResourceType = "application"
	ResourceTypeDatabase    ResourceType = "database"
	ResourceTypeService     ResourceType = "service"
)

func (*ResourceType) Scan

func (e *ResourceType) Scan(src interface{}) error

type RestoreDrill

type RestoreDrill struct {
	ID             int64
	Uuid           pgtype.UUID
	PlanID         int64
	ExecutionID    *int64
	Status         RestoreDrillStatus
	TablesExpected *int32
	TablesRestored *int32
	ErrorMessage   *string
	StartedAt      pgtype.Timestamptz
	FinishedAt     pgtype.Timestamptz
	DurationMs     *int32
}

type RestoreDrillStatus

type RestoreDrillStatus string
const (
	RestoreDrillStatusRunning   RestoreDrillStatus = "running"
	RestoreDrillStatusSucceeded RestoreDrillStatus = "succeeded"
	RestoreDrillStatusFailed    RestoreDrillStatus = "failed"
)

func (*RestoreDrillStatus) Scan

func (e *RestoreDrillStatus) Scan(src interface{}) error

type RevokeApiTokenByUUIDParams

type RevokeApiTokenByUUIDParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type RevokeApiTokensForUserInTeamParams

type RevokeApiTokensForUserInTeamParams struct {
	TeamID    int64
	CreatedBy *int64
}

type RevokeExternalEndpointGrantParams

type RevokeExternalEndpointGrantParams struct {
	Uuid      pgtype.UUID
	RevokedBy *int64
}

type RevokeInvitationParams

type RevokeInvitationParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type RevokeMcpAccessTokenParams

type RevokeMcpAccessTokenParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type RevokeScimTokenParams

type RevokeScimTokenParams struct {
	Uuid   pgtype.UUID
	TeamID int64
}

type RotateInvitationParams

type RotateInvitationParams struct {
	TokenHash string
	ExpiresAt pgtype.Timestamptz
	Uuid      pgtype.UUID
	TeamID    int64
}

type RuntimeConfig

type RuntimeConfig struct {
	ID                     int64
	ApplicationID          int64
	PortsExposes           *string
	PortsMappings          []byte
	CustomDockerOptions    *string
	CustomLabels           *string
	PreDeploymentCommand   *string
	PostDeploymentCommand  *string
	StopGracePeriodSeconds int32
	RestartLimit           *int32
	MemoryLimit            *string
	MemoryReservation      *string
	MemorySwap             *string
	MemorySwappiness       *int32
	CpuLimit               pgtype.Numeric
	CpuSets                *string
	CpuShares              *int32
	ForceHttps             bool
	RedirectDirection      RedirectDirection
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	Noindex                bool
}

type S3Storage

type S3Storage struct {
	ID             int64
	Uuid           pgtype.UUID
	TeamID         int64
	Name           string
	Endpoint       string
	Region         *string
	Bucket         string
	PathPrefix     *string
	AccessKeyEnc   []byte
	SecretKeyEnc   []byte
	IsUsable       bool
	LastCheckError *string
	CreatedBy      *int64
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	Version        int32
	SseAlgorithm   *string
}

type ScheduledTask

type ScheduledTask struct {
	ID              int64
	Uuid            pgtype.UUID
	TeamID          int64
	ResourceID      int64
	Container       *string
	Name            string
	Command         *string
	CronExpression  string
	Timezone        string
	Enabled         bool
	OverlapPolicy   TaskOverlapPolicy
	MissedRunPolicy TaskMissedRunPolicy
	TimeoutSeconds  int32
	NextRunAt       pgtype.Timestamptz
	LastRunAt       pgtype.Timestamptz
	CreatedBy       *int64
	UpdatedBy       *int64
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	DeletedAt       pgtype.Timestamptz
	Version         int32
	Kind            TaskKind
	WorkflowFile    *string
	WorkflowRef     *string
	WorkflowInputs  []byte
}

type ScimToken

type ScimToken struct {
	ID         int64
	Uuid       pgtype.UUID
	TeamID     int64
	Name       string
	TokenHash  string
	CreatedBy  *int64
	LastUsedAt pgtype.Timestamptz
	RevokedAt  pgtype.Timestamptz
	CreatedAt  pgtype.Timestamptz
}

type Server

type Server struct {
	ID                           int64
	Uuid                         pgtype.UUID
	TeamID                       int64
	Name                         string
	Description                  *string
	Host                         string
	Port                         int32
	SshUser                      string
	UseSudo                      bool
	SshTimeoutSeconds            int32
	PrivateKeyID                 int64
	Status                       ServerStatus
	ObservedAt                   pgtype.Timestamptz
	UnreachableSince             pgtype.Timestamptz
	OsName                       *string
	Architecture                 *string
	DockerVersion                *string
	IsLocalhost                  bool
	IsBuildServer                bool
	WildcardDomain               *string
	ProxyType                    ProxyType
	ProxyDesiredState            ProxyDesiredState
	ProxyObservedStatus          ResourceObservedStatus
	ProxyHttpPort                int32
	ProxyHttpsPort               int32
	ConcurrentBuilds             int32
	DeploymentQueueLimit         int32
	CleanupEnabled               bool
	CleanupDiskThresholdPct      *int32
	CleanupCron                  *string
	CleanupPruneVolumes          bool
	CleanupPruneNetworks         bool
	SentinelEnabled              bool
	SentinelTokenHash            *string
	SentinelPushIntervalSeconds  int32
	SentinelMetricsRetentionDays int32
	LogDrainKind                 LogDrainKind
	LogDrainConfigEnc            []byte
	CaCert                       *string
	CaKeyEnc                     []byte
	CloudCredentialID            *int64
	CloudExternalID              *string
	CreatedBy                    *int64
	UpdatedBy                    *int64
	CreatedAt                    pgtype.Timestamptz
	UpdatedAt                    pgtype.Timestamptz
	DeletedAt                    pgtype.Timestamptz
	Version                      int32
	HostKeyFingerprint           *string
	DnsCredentialID              *int64
	CleanupNextRunAt             pgtype.Timestamptz
	CleanupLastRunAt             pgtype.Timestamptz
}

type ServerStatus

type ServerStatus string
const (
	ServerStatusPending     ServerStatus = "pending"
	ServerStatusValidating  ServerStatus = "validating"
	ServerStatusReady       ServerStatus = "ready"
	ServerStatusUnreachable ServerStatus = "unreachable"
	ServerStatusMaintenance ServerStatus = "maintenance"
	ServerStatusDeleting    ServerStatus = "deleting"
)

func (*ServerStatus) Scan

func (e *ServerStatus) Scan(src interface{}) error

type Service

type Service struct {
	ID                         int64
	ComposeContent             string
	TemplateSlug               *string
	TemplateVersion            *string
	TemplateRepository         *string
	ConnectToPredefinedNetwork bool
	CreatedAt                  pgtype.Timestamptz
	UpdatedAt                  pgtype.Timestamptz
	AccessProtection           PreviewProtection
	AccessBasicAuthEnc         []byte
	Noindex                    bool
}

type ServiceComponent

type ServiceComponent struct {
	ID                 int64
	Uuid               pgtype.UUID
	ResourceID         int64
	Name               string
	Image              *string
	IsDatabase         bool
	DatabaseEngine     *DbEngine
	ExcludeFromHc      bool
	DefaultRoutePort   *int32
	ObservedStatus     ResourceObservedStatus
	ObservedAt         pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
	AccessPublicRoutes []byte
}

type Session

type Session struct {
	ID                 int64
	Uuid               pgtype.UUID
	UserID             int64
	TokenHash          string
	CurrentTeamID      *int64
	MfaVerifiedAt      pgtype.Timestamptz
	Ip                 *netip.Addr
	UserAgent          *string
	LastSeenAt         pgtype.Timestamptz
	ExpiresAt          pgtype.Timestamptz
	RevokedAt          pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
	CsrfToken          *string
	MfaPending         bool
	TotpVerifiedAt     pgtype.Timestamptz
	ViewAsRole         *TeamRole
	ViewAsCustomRoleID *int64
}

type SetApplicationAccessBasicAuthParams

type SetApplicationAccessBasicAuthParams struct {
	ID                 int64
	AccessBasicAuthEnc []byte
}

type SetApplicationAccessProtectionParams

type SetApplicationAccessProtectionParams struct {
	ID               int64
	AccessProtection PreviewProtection
}

type SetApplicationAccessPublicRoutesParams

type SetApplicationAccessPublicRoutesParams struct {
	ID                 int64
	AccessPublicRoutes []byte
}

type SetApplicationGitSourceParams

type SetApplicationGitSourceParams struct {
	ID          int64
	GitSourceID *int64
}

type SetBackupExecutionTableCountParams

type SetBackupExecutionTableCountParams struct {
	ID         int64
	TableCount *int32
}

type SetBackupPlanScheduleParams

type SetBackupPlanScheduleParams struct {
	ID        int64
	NextRunAt pgtype.Timestamptz
	LastRunAt pgtype.Timestamptz
}

type SetCertificateStatusParams

type SetCertificateStatusParams struct {
	ID        int64
	Status    CertificateStatus
	LastError *string
}

type SetDeploymentCommitMetaParams

type SetDeploymentCommitMetaParams struct {
	ID            int64
	CommitAuthor  *string
	CommitMessage *string
}

type SetDeploymentCommitParams

type SetDeploymentCommitParams struct {
	ID        int64
	CommitSha *string
	GitBranch *string
}

type SetDeploymentErrorParams

type SetDeploymentErrorParams struct {
	ID           int64
	ErrorMessage *string
}

type SetDeploymentImageDigestParams

type SetDeploymentImageDigestParams struct {
	ID          int64
	ImageDigest *string
}

type SetDeploymentImageParams

type SetDeploymentImageParams struct {
	ID        int64
	ImageName *string
	ImageTag  *string
}

type SetDeploymentStatusParams

type SetDeploymentStatusParams struct {
	ID     int64
	Status DeploymentStatus
}

type SetDeploymentStepLogParams

type SetDeploymentStepLogParams struct {
	ID  int64
	Log *string
}

type SetGitSourceAPITokenParams

type SetGitSourceAPITokenParams struct {
	ID          int64
	ApiTokenEnc []byte
}

type SetGitSourceAPIURLParams

type SetGitSourceAPIURLParams struct {
	ID     int64
	ApiUrl *string
}

type SetGithubAppInstallationParams

type SetGithubAppInstallationParams struct {
	ID             int64
	InstallationID *int64
}

type SetInstanceIdentityParams

type SetInstanceIdentityParams struct {
	Fqdn      *string
	AcmeEmail *string
}

type SetMembershipExternalIDParams

type SetMembershipExternalIDParams struct {
	ExternalID *string
	UserUuid   pgtype.UUID
	TeamID     int64
}

type SetPlanDrillResultParams

type SetPlanDrillResultParams struct {
	ID              int64
	LastDrillStatus *RestoreDrillStatus
}

type SetPortForwardAuthorizedUntilParams

type SetPortForwardAuthorizedUntilParams struct {
	ID              int64
	AuthorizedUntil pgtype.Timestamptz
}

type SetPreviewFqdnParams

type SetPreviewFqdnParams struct {
	ID   int64
	Fqdn *string
}

type SetPreviewRandomSlugParams

type SetPreviewRandomSlugParams struct {
	ID         int64
	RandomSlug *string
}

type SetPreviewStatusParams

type SetPreviewStatusParams struct {
	ID           int64
	Status       PreviewStatus
	CleanupError *string
}

type SetProxyDesiredStateParams

type SetProxyDesiredStateParams struct {
	ID                int64
	ProxyDesiredState ProxyDesiredState
}

type SetProxyObservedStatusParams

type SetProxyObservedStatusParams struct {
	ID                  int64
	ProxyObservedStatus ResourceObservedStatus
}

type SetResourceAdoptionParams

type SetResourceAdoptionParams struct {
	ID       int64
	Adoption []byte
}

type SetResourceDesiredStatusParams

type SetResourceDesiredStatusParams struct {
	ID            int64
	DesiredStatus ResourceDesiredStatus
}

type SetResourceObservedStatusParams

type SetResourceObservedStatusParams struct {
	ID             int64
	ObservedStatus ResourceObservedStatus
}

type SetResourceRemnantsParams

type SetResourceRemnantsParams struct {
	ID       int64
	Remnants []byte
}

type SetS3StorageCheckParams

type SetS3StorageCheckParams struct {
	ID             int64
	IsUsable       bool
	LastCheckError *string
}

type SetScheduledTaskScheduleParams

type SetScheduledTaskScheduleParams struct {
	ID        int64
	NextRunAt pgtype.Timestamptz
	LastRunAt pgtype.Timestamptz
}

type SetServerCAParams

type SetServerCAParams struct {
	ID       int64
	CaCert   *string
	CaKeyEnc []byte
}

type SetServerCleanupScheduleParams

type SetServerCleanupScheduleParams struct {
	ID        int64
	NextRunAt pgtype.Timestamptz
	LastRunAt pgtype.Timestamptz
}

type SetServerStatusParams

type SetServerStatusParams struct {
	ID     int64
	Status ServerStatus
}

type SetServiceAccessBasicAuthParams

type SetServiceAccessBasicAuthParams struct {
	ID                 int64
	AccessBasicAuthEnc []byte
}

type SetServiceAccessProtectionParams

type SetServiceAccessProtectionParams struct {
	ID               int64
	AccessProtection PreviewProtection
}

type SetServiceComponentObservedByNameParams

type SetServiceComponentObservedByNameParams struct {
	Uuid           pgtype.UUID
	Name           string
	ObservedStatus ResourceObservedStatus
	ServerID       int64
}

type SetServiceComponentObservedParams

type SetServiceComponentObservedParams struct {
	ID             int64
	ObservedStatus ResourceObservedStatus
}

type SetServiceNoindexParams

type SetServiceNoindexParams struct {
	ID      int64
	Noindex bool
}

type SetSessionCurrentTeamParams

type SetSessionCurrentTeamParams struct {
	ID            int64
	CurrentTeamID *int64
}

type SetSessionViewAsParams

type SetSessionViewAsParams struct {
	ID                 int64
	ViewAsRole         *TeamRole
	ViewAsCustomRoleID *int64
}

type SetUptimeCheckStateParams

type SetUptimeCheckStateParams struct {
	ID                   int64
	Status               UptimeStatus
	ConsecutiveFailures  int32
	ConsecutiveSuccesses int32
	StatusSince          pgtype.Timestamptz
	LastLatencyMs        *int32
	LastError            *string
	NextRunAt            pgtype.Timestamptz
}

type SetUserLastTeamParams

type SetUserLastTeamParams struct {
	ID         int64
	LastTeamID *int64
}

type SharedVariable

type SharedVariable struct {
	ID            int64
	Uuid          pgtype.UUID
	TeamID        int64
	Scope         SharedVariableScope
	ProjectID     *int64
	EnvironmentID *int64
	ServerID      *int64
	Key           string
	ValueEnc      []byte
	IsSecret      bool
	CreatedBy     *int64
	UpdatedBy     *int64
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
}

type SharedVariableScope

type SharedVariableScope string
const (
	SharedVariableScopeTeam        SharedVariableScope = "team"
	SharedVariableScopeProject     SharedVariableScope = "project"
	SharedVariableScopeEnvironment SharedVariableScope = "environment"
	SharedVariableScopeServer      SharedVariableScope = "server"
)

func (*SharedVariableScope) Scan

func (e *SharedVariableScope) Scan(src interface{}) error

type StorageKind

type StorageKind string
const (
	StorageKindVolume StorageKind = "volume"
	StorageKindBind   StorageKind = "bind"
	StorageKindFile   StorageKind = "file"
)

func (*StorageKind) Scan

func (e *StorageKind) Scan(src interface{}) error

type SucceedJobParams

type SucceedJobParams struct {
	ID       int64
	Result   []byte
	WorkerID *string
}

type SupersedeObsoletePreviewDeploymentsParams

type SupersedeObsoletePreviewDeploymentsParams struct {
	PreviewID      *int64
	SupersededByID *int64
}

type SupersedeQueuedDeploymentsParams

type SupersedeQueuedDeploymentsParams struct {
	ResourceID     int64
	SupersededByID *int64
}

type SweepPortForwardSessionsRow

type SweepPortForwardSessionsRow struct {
	TeamID int64
	Uuid   pgtype.UUID
}

type Tag

type Tag struct {
	ID        int64
	Uuid      pgtype.UUID
	TeamID    int64
	Name      string
	CreatedAt pgtype.Timestamptz
}

type TagResourceParams

type TagResourceParams struct {
	ResourceID int64
	TagID      int64
}

type TaskExecution

type TaskExecution struct {
	ID              int64
	Uuid            pgtype.UUID
	ScheduledTaskID int64
	Status          TaskExecutionStatus
	SkipReason      *string
	ExitCode        *int32
	Output          *string
	OutputTruncated bool
	StartedAt       pgtype.Timestamptz
	FinishedAt      pgtype.Timestamptz
	DurationMs      *int32
}

type TaskExecutionStatus

type TaskExecutionStatus string
const (
	TaskExecutionStatusRunning   TaskExecutionStatus = "running"
	TaskExecutionStatusSucceeded TaskExecutionStatus = "succeeded"
	TaskExecutionStatusFailed    TaskExecutionStatus = "failed"
	TaskExecutionStatusSkipped   TaskExecutionStatus = "skipped"
)

func (*TaskExecutionStatus) Scan

func (e *TaskExecutionStatus) Scan(src interface{}) error

type TaskKind

type TaskKind string
const (
	TaskKindContainerCommand TaskKind = "container_command"
	TaskKindGithubWorkflow   TaskKind = "github_workflow"
)

func (*TaskKind) Scan

func (e *TaskKind) Scan(src interface{}) error

type TaskMissedRunPolicy

type TaskMissedRunPolicy string
const (
	TaskMissedRunPolicyRun  TaskMissedRunPolicy = "run"
	TaskMissedRunPolicySkip TaskMissedRunPolicy = "skip"
)

func (*TaskMissedRunPolicy) Scan

func (e *TaskMissedRunPolicy) Scan(src interface{}) error

type TaskOverlapPolicy

type TaskOverlapPolicy string
const (
	TaskOverlapPolicySkip  TaskOverlapPolicy = "skip"
	TaskOverlapPolicyQueue TaskOverlapPolicy = "queue"
)

func (*TaskOverlapPolicy) Scan

func (e *TaskOverlapPolicy) Scan(src interface{}) error

type Team

type Team struct {
	ID          int64
	Uuid        pgtype.UUID
	Name        string
	Description *string
	CreatedBy   *int64
	UpdatedBy   *int64
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	Version     int32
	Personal    bool
}

type TeamMembership

type TeamMembership struct {
	ID           int64
	TeamID       int64
	UserID       int64
	Role         TeamRole
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
	CustomRoleID *int64
	ExternalID   *string
}

type TeamRole

type TeamRole string
const (
	TeamRoleOwner    TeamRole = "owner"
	TeamRoleAdmin    TeamRole = "admin"
	TeamRoleMember   TeamRole = "member"
	TeamRoleReviewer TeamRole = "reviewer"
	TeamRoleNone     TeamRole = "none"
)

func (*TeamRole) Scan

func (e *TeamRole) Scan(src interface{}) error

type TerminalEndReason

type TerminalEndReason string
const (
	TerminalEndReasonUserClose         TerminalEndReason = "user_close"
	TerminalEndReasonIdleTimeout       TerminalEndReason = "idle_timeout"
	TerminalEndReasonMaxDuration       TerminalEndReason = "max_duration"
	TerminalEndReasonDisconnect        TerminalEndReason = "disconnect"
	TerminalEndReasonRevoked           TerminalEndReason = "revoked"
	TerminalEndReasonGrantExpired      TerminalEndReason = "grant_expired"
	TerminalEndReasonTargetStopped     TerminalEndReason = "target_stopped"
	TerminalEndReasonTargetUnreachable TerminalEndReason = "target_unreachable"
	TerminalEndReasonWakeFailed        TerminalEndReason = "wake_failed"
)

func (*TerminalEndReason) Scan

func (e *TerminalEndReason) Scan(src interface{}) error

type TerminalSession

type TerminalSession struct {
	ID              int64
	Uuid            pgtype.UUID
	TeamID          int64
	UserID          *int64
	TargetKind      TerminalTarget
	ServerID        *int64
	ResourceID      *int64
	TargetName      string
	ClientIp        *netip.Addr
	TokenHash       string
	TokenExpiresAt  pgtype.Timestamptz
	ClaimedAt       pgtype.Timestamptz
	StartedAt       pgtype.Timestamptz
	EndedAt         pgtype.Timestamptz
	EndReason       *TerminalEndReason
	CreatedAt       pgtype.Timestamptz
	TargetComponent *string
	PreviewID       *int64
	AttachKeyHash   []byte
	AttachSeq       int64
	StreamedAt      pgtype.Timestamptz
	LastHeartbeatAt pgtype.Timestamptz
}

type TerminalTarget

type TerminalTarget string
const (
	TerminalTargetServer    TerminalTarget = "server"
	TerminalTargetContainer TerminalTarget = "container"
)

func (*TerminalTarget) Scan

func (e *TerminalTarget) Scan(src interface{}) error

type TouchMfaFactorUsedParams

type TouchMfaFactorUsedParams struct {
	ID     int64
	UsedAt pgtype.Timestamptz
}

type UpdateApplicationGitSettingsParams

type UpdateApplicationGitSettingsParams struct {
	ID                int64
	GitRepositoryUrl  *string
	GitBranch         *string
	BaseDirectory     *string
	SetWatchPaths     bool
	WatchPaths        *string
	AutoDeployEnabled *bool
}

type UpdateApplicationPreviewSettingsParams

type UpdateApplicationPreviewSettingsParams struct {
	ID                             int64
	PreviewsEnabled                *bool
	PreviewUrlTemplate             *string
	SetMaxConcurrent               bool
	PreviewMaxConcurrent           *int32
	SetTtl                         bool
	PreviewTtlMinutes              *int32
	PreviewProtection              *PreviewProtection
	PreviewForkApprovalEnabled     *bool
	PreviewExcludeDrafts           *bool
	PreviewDeployOnOpen            *bool
	SetUrlTemplates                bool
	PreviewUrlTemplates            []byte
	SetRequireLabel                bool
	PreviewRequireLabel            *string
	PreviewCommentCommandsEnabled  *bool
	PreviewCancelObsoleteBuilds    *bool
	PreviewScaleToZero             *bool
	PreviewScaleToZeroAfterMinutes *int32
}

type UpdateApplicationScaleToZeroParams

type UpdateApplicationScaleToZeroParams struct {
	ID                      int64
	ScaleToZero             *bool
	ScaleToZeroAfterMinutes *int32
}

type UpdateBackupPlanParams

type UpdateBackupPlanParams struct {
	ID                     int64
	CronExpression         string
	Timezone               string
	Enabled                bool
	DumpAll                bool
	S3StorageID            *int64
	S3Only                 bool
	SaveLocal              bool
	RetentionLocalMaxCount int32
	RetentionLocalMaxDays  int32
	RetentionS3MaxCount    int32
	RetentionS3MaxDays     int32
	DrillEnabled           bool
	DrillIntervalDays      int32
	ExpectedVersion        int32
}

type UpdateBuildConfigGitPipelineParams

type UpdateBuildConfigGitPipelineParams struct {
	ApplicationID       int64
	BuildPack           *BuildPack
	DockerfilePath      *string
	SetPublishDirectory bool
	PublishDirectory    *string
	ComposeFilePath     *string
	RawCompose          *bool
}

type UpdateBuildConfigSourceParams

type UpdateBuildConfigSourceParams struct {
	ApplicationID             int64
	ImageName                 *string
	ImageTag                  *string
	DockerfileContent         *string
	SetRegistryCredential     bool
	RegistryCredentialID      *int64
	UseBuildServer            *bool
	PushEnabled               *bool
	SetPushRegistryCredential bool
	PushRegistryCredentialID  *int64
}

type UpdateCustomRoleParams

type UpdateCustomRoleParams struct {
	Name           *string
	SetDescription bool
	Description    *string
	Permissions    []string
	Uuid           pgtype.UUID
	TeamID         int64
}

type UpdateDatabasePasswordParams

type UpdateDatabasePasswordParams struct {
	DatabaseID  int64
	PasswordEnc []byte
}

type UpdateDatabaseRowParams

type UpdateDatabaseRowParams struct {
	ID               int64
	Image            *string
	ImageTag         *string
	CustomConfig     *string
	IsPublic         bool
	PublicAccessMode *PublicAccessMode
	PublicPort       *int32
	SslMode          *string
}

type UpdateEnvVarParams

type UpdateEnvVarParams struct {
	ID          int64
	ValueEnc    []byte
	IsBuildTime bool
	IsLiteral   bool
	IsMultiline bool
	IsLocked    bool
}

type UpdateEnvironmentParams

type UpdateEnvironmentParams struct {
	ID              int64
	Name            string
	Slug            string
	Description     *string
	ExpectedVersion int32
}

type UpdateExternalEndpointParams

type UpdateExternalEndpointParams struct {
	ID              int64
	Name            string
	Host            string
	Port            int32
	ServerID        int64
	Criticality     ExternalEndpointCriticality
	MaxGrantMinutes int32
	Description     *string
	ProjectID       *int64
	EnvironmentID   *int64
	UpdatedBy       *int64
}

type UpdateIngressEndpointParams

type UpdateIngressEndpointParams struct {
	Uuid          pgtype.UUID
	TeamID        int64
	Name          string
	Access        IngressAccess
	Description   *string
	BasicAuthHash *string
	UpdatedBy     *int64
}

type UpdateJobStepsParams

type UpdateJobStepsParams struct {
	ID    int64
	Steps []byte
}

type UpdateNotificationChannelParams

type UpdateNotificationChannelParams struct {
	ID              int64
	Name            string
	ConfigEnc       []byte
	Enabled         bool
	ExpectedVersion int32
}

type UpdatePasskeyCredentialParams

type UpdatePasskeyCredentialParams struct {
	ID         int64
	Credential []byte
}

type UpdatePrivateKeyParams

type UpdatePrivateKeyParams struct {
	ID                int64
	Name              string
	Description       *string
	FingerprintSha256 string
	PublicKey         string
	PrivateKeyEnc     []byte
	ExpectedVersion   int32
}

type UpdateProjectParams

type UpdateProjectParams struct {
	ID              int64
	Name            string
	Slug            string
	Description     *string
	ExpectedVersion int32
}

type UpdateRegistryCredentialParams

type UpdateRegistryCredentialParams struct {
	Name            *string
	RegistryUrl     *string
	Username        *string
	PasswordEnc     []byte
	UpdatedBy       *int64
	ID              int64
	ExpectedVersion int32
}

type UpdateResourceMetaParams

type UpdateResourceMetaParams struct {
	ID              int64
	Name            string
	Description     *string
	ExpectedVersion int32
}

type UpdateRuntimeSettingsParams

type UpdateRuntimeSettingsParams struct {
	ApplicationID         int64
	PortsExposes          *string
	MemoryLimit           *string
	PreDeploymentCommand  *string
	PostDeploymentCommand *string
	Noindex               bool
}

type UpdateS3StorageParams

type UpdateS3StorageParams struct {
	ID              int64
	Name            string
	Endpoint        string
	Region          *string
	Bucket          string
	PathPrefix      *string
	AccessKeyEnc    []byte
	SecretKeyEnc    []byte
	IsUsable        bool
	LastCheckError  *string
	SseAlgorithm    *string
	ExpectedVersion int32
}

type UpdateScheduledTaskParams

type UpdateScheduledTaskParams struct {
	Name              *string
	Command           *string
	SetContainer      bool
	Container         *string
	CronExpression    *string
	Timezone          *string
	Enabled           *bool
	OverlapPolicy     *TaskOverlapPolicy
	MissedRunPolicy   *TaskMissedRunPolicy
	TimeoutSeconds    *int32
	WorkflowFile      *string
	SetWorkflowRef    bool
	WorkflowRef       *string
	SetWorkflowInputs bool
	WorkflowInputs    []byte
	UpdatedBy         *int64
	ID                int64
	Version           int32
}

type UpdateServerParams

type UpdateServerParams struct {
	ID                      int64
	Name                    string
	Description             *string
	Host                    string
	Port                    int32
	SshUser                 string
	SshTimeoutSeconds       int32
	PrivateKeyID            int64
	IsBuildServer           bool
	WildcardDomain          *string
	ProxyType               ProxyType
	ProxyHttpPort           int32
	ProxyHttpsPort          int32
	Status                  ServerStatus
	DnsCredentialID         *int64
	CleanupEnabled          bool
	CleanupCron             *string
	CleanupDiskThresholdPct *int32
	CleanupPruneVolumes     bool
	CleanupPruneNetworks    bool
	ExpectedVersion         int32
}

type UpdateServiceComposeParams

type UpdateServiceComposeParams struct {
	ID                         int64
	ComposeContent             string
	ConnectToPredefinedNetwork bool
}

type UpdateSharedVariableParams

type UpdateSharedVariableParams struct {
	ID       int64
	ValueEnc []byte
	IsSecret bool
}

type UpdateTeamMemberRoleParams

type UpdateTeamMemberRoleParams struct {
	Role         TeamRole
	CustomRoleID *int64
	UserUuid     pgtype.UUID
	TeamID       int64
}

type UpdateTeamParams

type UpdateTeamParams struct {
	ID             int64
	Name           *string
	SetDescription bool
	Description    *string
}

type UpdateUptimeCheckParams

type UpdateUptimeCheckParams struct {
	ID               int64
	Name             string
	Target           string
	IntervalSeconds  int32
	TimeoutSeconds   int32
	FailureThreshold int32
	SuccessThreshold int32
	Enabled          bool
	ExpectedVersion  int32
}

type UpsertCertificateParams

type UpsertCertificateParams struct {
	ServerID   int64
	Kind       CertificateKind
	MainDomain string
	Sans       []string
	Issuer     *string
	NotBefore  pgtype.Timestamptz
	NotAfter   pgtype.Timestamptz
	Status     CertificateStatus
}

type UpsertHealthCheckParams

type UpsertHealthCheckParams struct {
	ResourceID         int64
	Enabled            bool
	Method             string
	Path               string
	Port               *int32
	IntervalSeconds    int32
	TimeoutSeconds     int32
	Retries            int32
	StartPeriodSeconds int32
}

type UpsertOauthProviderConfigParams

type UpsertOauthProviderConfigParams struct {
	Uuid            pgtype.UUID
	Provider        OauthProvider
	DisplayName     *string
	ClientID        string
	ClientSecretEnc []byte
	IssuerUrl       *string
	Enabled         bool
}

type UpsertPreviewParams

type UpsertPreviewParams struct {
	ApplicationID int64
	Provider      GitProvider
	PrID          int32
	IsFork        bool
	SourceBranch  *string
	HeadSha       *string
	RepoReference *string
}

type UpsertRepositoryParams

type UpsertRepositoryParams struct {
	GitSourceID   int64
	ExternalID    string
	FullName      string
	DefaultBranch *string
	HtmlUrl       *string
}

type UpsertServiceComponentParams

type UpsertServiceComponentParams struct {
	ResourceID         int64
	Name               string
	IsDatabase         bool
	ExcludeFromHc      bool
	AccessPublicRoutes []byte
	Image              *string
	DatabaseEngine     *DbEngine
	DefaultRoutePort   *int32
}

type UpsertTagParams

type UpsertTagParams struct {
	TeamID int64
	Name   string
}

type UpsertUnconfirmedMfaFactorParams

type UpsertUnconfirmedMfaFactorParams struct {
	Uuid      pgtype.UUID
	UserID    int64
	SecretEnc []byte
}

type UptimeCheck

type UptimeCheck struct {
	ID                   int64
	Uuid                 pgtype.UUID
	TeamID               int64
	ResourceID           *int64
	Name                 string
	Kind                 UptimeCheckKind
	Target               string
	IntervalSeconds      int32
	TimeoutSeconds       int32
	FailureThreshold     int32
	SuccessThreshold     int32
	Enabled              bool
	Status               UptimeStatus
	StatusSince          pgtype.Timestamptz
	ConsecutiveFailures  int32
	ConsecutiveSuccesses int32
	LastCheckedAt        pgtype.Timestamptz
	LastLatencyMs        *int32
	LastError            *string
	NextRunAt            pgtype.Timestamptz
	CreatedBy            *int64
	CreatedAt            pgtype.Timestamptz
	UpdatedAt            pgtype.Timestamptz
	DeletedAt            pgtype.Timestamptz
	Version              int32
}

type UptimeCheckKind

type UptimeCheckKind string
const (
	UptimeCheckKindHttp UptimeCheckKind = "http"
	UptimeCheckKindTcp  UptimeCheckKind = "tcp"
)

func (*UptimeCheckKind) Scan

func (e *UptimeCheckKind) Scan(src interface{}) error

type UptimeCheckResult

type UptimeCheckResult struct {
	ID         int64
	CheckID    int64
	CheckedAt  pgtype.Timestamptz
	Ok         bool
	LatencyMs  *int32
	StatusCode *int32
	Error      *string
}

type UptimeStatus

type UptimeStatus string
const (
	UptimeStatusUnknown UptimeStatus = "unknown"
	UptimeStatusUp      UptimeStatus = "up"
	UptimeStatusDown    UptimeStatus = "down"
)

func (*UptimeStatus) Scan

func (e *UptimeStatus) Scan(src interface{}) error

type User

type User struct {
	ID               int64
	Uuid             pgtype.UUID
	Email            string
	Name             string
	PasswordHash     *string
	IsRoot           bool
	EmailVerifiedAt  pgtype.Timestamptz
	FailedLoginCount int32
	LockedUntil      pgtype.Timestamptz
	CreatedAt        pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
	DeletedAt        pgtype.Timestamptz
	Version          int32
	LastTeamID       *int64
}

type WakeSleptApplicationForServerParams

type WakeSleptApplicationForServerParams struct {
	Uuid     pgtype.UUID
	ServerID int64
}

type WebhookDelivery

type WebhookDelivery struct {
	ID                int64
	Uuid              pgtype.UUID
	Provider          WebhookProvider
	DeliveryID        string
	WebhookEndpointID *int64
	EventType         *string
	SignatureValid    bool
	Status            WebhookDeliveryStatus
	IgnoreReason      *string
	Payload           []byte
	TeamID            *int64
	ApplicationID     *int64
	ReceivedAt        pgtype.Timestamptz
	ProcessedAt       pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
}

type WebhookDeliveryStatus

type WebhookDeliveryStatus string
const (
	WebhookDeliveryStatusReceived  WebhookDeliveryStatus = "received"
	WebhookDeliveryStatusAccepted  WebhookDeliveryStatus = "accepted"
	WebhookDeliveryStatusIgnored   WebhookDeliveryStatus = "ignored"
	WebhookDeliveryStatusDuplicate WebhookDeliveryStatus = "duplicate"
	WebhookDeliveryStatusFailed    WebhookDeliveryStatus = "failed"
)

func (*WebhookDeliveryStatus) Scan

func (e *WebhookDeliveryStatus) Scan(src interface{}) error

type WebhookEndpoint

type WebhookEndpoint struct {
	ID            int64
	Uuid          pgtype.UUID
	ApplicationID int64
	Provider      WebhookProvider
	SecretEnc     []byte
	Enabled       bool
	CreatedBy     *int64
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
}

type WebhookProvider

type WebhookProvider string
const (
	WebhookProviderGithub    WebhookProvider = "github"
	WebhookProviderGitlab    WebhookProvider = "gitlab"
	WebhookProviderBitbucket WebhookProvider = "bitbucket"
	WebhookProviderGitea     WebhookProvider = "gitea"
	WebhookProviderGeneric   WebhookProvider = "generic"
)

func (*WebhookProvider) Scan

func (e *WebhookProvider) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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