pgdb

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInvite

type AccountInvite struct {
	ID        string
	TokenHash string
	Email     string
	CreatedAt time.Time
	ExpiresAt time.Time
	UsedAt    *time.Time
	UsedBy    *string
	RevokedAt *time.Time
}

type AccountPasswordByIDRow

type AccountPasswordByIDRow struct {
	UserID       string
	Username     string
	Admin        bool
	Method       string
	PasswordHash string
}

type AccountPasswordRow

type AccountPasswordRow struct {
	UserID       string
	Username     string
	Admin        bool
	Method       string
	PasswordHash string
}

type AccountSummariesRow

type AccountSummariesRow struct {
	UserID    string
	Username  string
	Admin     bool
	Email     string
	Disabled  bool
	Method    string
	CreatedAt time.Time
}

type ActiveJobUsageRow

type ActiveJobUsageRow struct {
	Jobs  int64
	Bytes int64
}

type AdminAccount

type AdminAccount struct {
	UserID string
}

type AdminSetup

type AdminSetup struct {
	Singleton bool
	TokenHash string
	ExpiresAt time.Time
}

type AdvanceStreamHeadParams

type AdvanceStreamHeadParams struct {
	OwnerID          string
	SourceID         string
	RepositoryKey    string
	CheckoutKey      string
	Branch           string
	ComparisonPolicy string
	ContextID        string
	CollectedAt      int64
	ArrivalSequence  int64
}

type AgentSession

type AgentSession struct {
	OwnerID   string
	SourceID  string
	Harness   string
	SessionID string
	Name      string
	NamedAt   int64
}

type AppSetting added in v0.2.4

type AppSetting struct {
	Singleton      bool
	SignupOpen     bool
	PasswordSignup bool
	UpdatedAt      time.Time
	UpdatedBy      *string
}

type AppSettingsRow added in v0.2.4

type AppSettingsRow struct {
	SignupOpen     bool
	PasswordSignup bool
}

type AuthAttempt

type AuthAttempt struct {
	Client      string
	WindowStart time.Time
	Attempts    int32
}

type BindSubmissionParams

type BindSubmissionParams struct {
	Sequence  int64
	ContextID string
}

type BrowserSession

type BrowserSession struct {
	SecretHash string
	UserID     string
	CsrfToken  string
	ExpiresAt  time.Time
}

type ClaimGitHubRefreshParams

type ClaimGitHubRefreshParams struct {
	Token      string
	LeaseUntil time.Time
	Now        time.Time
}

type ClaimGitHubRefreshRow

type ClaimGitHubRefreshRow struct {
	RepositoryID     int64
	InstallationID   int64
	FullName         string
	Number           int32
	LeasedGeneration int64
	LeasedRun        string
	Attempt          int32
}

type ClaimJobParams

type ClaimJobParams struct {
	LeaseToken string
	LeaseUntil time.Time
	Now        time.Time
}

type ClaimJobRow

type ClaimJobRow struct {
	ID           string
	OwnerID      string
	SubmissionID string
	Payload      []byte
	Attempt      int32
}

type ClaimNotificationsParams

type ClaimNotificationsParams struct {
	Now        time.Time
	MaxCount   int32
	LeaseToken string
	LeaseUntil time.Time
}

type ClaimNotificationsRow

type ClaimNotificationsRow struct {
	ID           string
	OwnerID      string
	Kind         string
	Payload      []byte
	Attempt      int32
	CreatedAt    time.Time
	Available    bool
	JobState     string
	JobContextID string
}

type Comment

type Comment struct {
	ID        string
	ReviewID  string
	VersionID *string
	FileID    string
	Data      []byte
	CreatedAt int64
}

type CommentsParams

type CommentsParams struct {
	ContextID string
	Now       time.Time
}

type CompleteGitHubRefreshParams

type CompleteGitHubRefreshParams struct {
	State        string
	RepositoryID int64
	Number       int32
	Token        string
	Now          time.Time
}

type CompleteJobParams

type CompleteJobParams struct {
	ContextID  string
	ID         string
	LeaseToken string
	Now        time.Time
}

type ConsumeAdminSetupParams

type ConsumeAdminSetupParams struct {
	TokenHash string
	Now       time.Time
}

type ConsumePasswordResetParams added in v0.2.4

type ConsumePasswordResetParams struct {
	TokenHash string
	Now       time.Time
}

type Context

type Context struct {
	ID              string
	OwnerID         string
	Kind            string
	AnchorDiffID    string
	CreatedAt       time.Time
	LastSubmittedAt time.Time
	SubmittedFrom   *string
}

type ContextExpiryParams

type ContextExpiryParams struct {
	OwnerID string
	ID      string
}

type ContextForDeleteParams

type ContextForDeleteParams struct {
	OwnerID string
	ID      string
}

type ContextForDeleteRow

type ContextForDeleteRow struct {
	AnchorDiffID string
	StreamKey    *string
}

type ContextStreamParams

type ContextStreamParams struct {
	OwnerID string
	ID      string
}

type ContextStreamRow

type ContextStreamRow struct {
	ExpiresAt            *time.Time
	HeadSourceID         *string
	HeadRepositoryKey    *string
	HeadCheckoutKey      *string
	HeadBranch           *string
	HeadComparisonPolicy *string
}

type CountAuthAttemptParams

type CountAuthAttemptParams struct {
	Client  string
	Now     time.Time
	Expired time.Time
}

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 DeleteContextDiffsParams

type DeleteContextDiffsParams struct {
	OwnerID   string
	AnchorID  string
	ContextID string
}

type DeleteDiffParams

type DeleteDiffParams struct {
	OwnerID string
	ID      string
}

type DeleteGitHubFollowParams

type DeleteGitHubFollowParams struct {
	OwnerID      string
	RepositoryID int64
}

type DeleteIdentityTokenParams

type DeleteIdentityTokenParams struct {
	UserID string
	ID     string
}

type DeleteOwnedSubscriptionParams

type DeleteOwnedSubscriptionParams struct {
	OwnerID string
	ID      string
}

type DeleteStreamCommentsParams

type DeleteStreamCommentsParams struct {
	Ids       []string
	ContextID string
}

type DeleteVisibleMarksParams

type DeleteVisibleMarksParams struct {
	Mode      string
	ContextID string
	FileID    *string
}

type Diff

type Diff struct {
	ID        string
	OwnerID   string
	Kind      string
	Mode      string
	CreatedAt time.Time
	ExpiresAt *time.Time
}

type DiffFile

type DiffFile struct {
	VersionID   string
	FileID      string
	Path        string
	Fingerprint string
	Patch       []byte
	PatchDigest string
}

type DiffVersion

type DiffVersion struct {
	ID             string
	DiffID         string
	Revision       string
	Manifest       []byte
	Source         string
	ComparisonKind string
	CreatedAt      time.Time
}

type DisableAccountParams

type DisableAccountParams struct {
	UserID     string
	DisabledAt time.Time
}

type DisabledAccount

type DisabledAccount struct {
	UserID     string
	DisabledAt time.Time
}

type EndStreamParams

type EndStreamParams struct {
	OwnerID   string
	StreamKey string
}

type EnsureReviewParams

type EnsureReviewParams struct {
	ID        string
	OwnerID   string
	StreamKey string
	Mode      string
}

type ExtendObservationParams

type ExtendObservationParams struct {
	ExpiresAt time.Time
	ContextID string
}

type FailJobParams

type FailJobParams struct {
	Detail     string
	ID         string
	LeaseToken string
	Now        time.Time
}

type FinishNotificationParams

type FinishNotificationParams struct {
	State      string
	ID         string
	LeaseToken string
}

type ForgetIdentityParams

type ForgetIdentityParams struct {
	OwnerID      string
	IdentityHash string
}

type GitHubFollowsRow

type GitHubFollowsRow struct {
	OwnerID        string
	RepositoryID   int64
	InstallationID int64
	FullName       string
	Status         string
	VerifiedAt     time.Time
	CreatedAt      time.Time
	Muted          bool
}

type GitHubLeasedParams

type GitHubLeasedParams struct {
	RepositoryID int64
	Number       int32
	Token        string
	Now          time.Time
}

type GitHubLeasedRow

type GitHubLeasedRow struct {
	RepositoryID     int64
	InstallationID   int64
	FullName         string
	Number           int32
	LeasedGeneration int64
	LeasedRun        string
	Attempt          int32
	Leased           []byte
}

type GitHubPullRequestHeadParams

type GitHubPullRequestHeadParams struct {
	RepositoryID int64
	Number       int32
}

type GitHubPullRequestHeadRow

type GitHubPullRequestHeadRow struct {
	HeadSha string
	Opened  bool
}

type GitHubRepositoryFollowsRow

type GitHubRepositoryFollowsRow struct {
	OwnerID        string
	RepositoryID   int64
	InstallationID int64
	FullName       string
	Status         string
	VerifiedAt     time.Time
	CreatedAt      time.Time
	Muted          bool
}

type GithubConnection

type GithubConnection struct {
	OwnerID          string
	UserID           int64
	Login            string
	AccessToken      []byte
	AccessExpiresAt  time.Time
	RefreshToken     []byte
	RefreshExpiresAt time.Time
	Status           string
	ConnectedAt      time.Time
}

type GithubDelivery

type GithubDelivery struct {
	ID         string
	Event      string
	ReceivedAt time.Time
}

type GithubFollow

type GithubFollow struct {
	OwnerID        string
	RepositoryID   int64
	InstallationID int64
	FullName       string
	Status         string
	VerifiedAt     time.Time
	CreatedAt      time.Time
}

type GithubFollowMute

type GithubFollowMute struct {
	OwnerID      string
	RepositoryID int64
}

type GithubOauthState

type GithubOauthState struct {
	StateHash string
	OwnerID   string
	ExpiresAt time.Time
}

type GithubPrHead

type GithubPrHead struct {
	RepositoryID int64
	Number       int32
	HeadSha      string
	Opened       bool
}

type GithubPullRequest

type GithubPullRequest struct {
	RepositoryID        int64
	Number              int32
	InstallationID      int64
	FullName            string
	Generation          int64
	RefreshedGeneration int64
	State               string
	RetentionRun        string
	RequestedAt         time.Time
	LeaseToken          string
	LeaseUntil          time.Time
	LeasedGeneration    int64
	LeasedRun           string
	Leased              []byte
	Attempt             int32
	AvailableAt         time.Time
	Detail              string
}

type GoogleAccountRow

type GoogleAccountRow struct {
	UserID   string
	Username string
	Admin    bool
	Disabled bool
}

type GoogleAuthState

type GoogleAuthState struct {
	StateHash    string
	BindingHash  string
	Nonce        string
	PkceVerifier string
	InviteID     *string
	ExpiresAt    time.Time
	SetupHash    *string
}

type GoogleIdentity

type GoogleIdentity struct {
	Sub       string
	UserID    string
	Email     string
	UpdatedAt time.Time
}

type HoldNotificationLeaseParams

type HoldNotificationLeaseParams struct {
	ID         string
	LeaseToken string
}

type IdentityAccountsRow

type IdentityAccountsRow struct {
	UserID   string
	Username string
	Admin    bool
	Method   string
}

type IdentityToken

type IdentityToken struct {
	ID         string
	UserID     string
	Name       string
	Purpose    string
	SecretHash string
	CreatedAt  time.Time
	LastUsedAt *time.Time
	ExpiresAt  time.Time
}

type IdentityTokensRow

type IdentityTokensRow struct {
	ID         string
	Name       string
	Purpose    string
	CreatedAt  time.Time
	LastUsedAt *time.Time
	ExpiresAt  time.Time
}

type IngestionJob

type IngestionJob struct {
	ID          string
	Sequence    int64
	Payload     []byte
	State       string
	Attempt     int32
	AvailableAt time.Time
	LeaseUntil  time.Time
	LeaseToken  string
	Detail      string
	ContextID   string
}

type IngestionRecord

type IngestionRecord struct {
	Sequence     int64
	OwnerID      string
	SourceID     string
	SubmissionID string
	PayloadHash  string
	ContextID    string
}

type IngestionRecordParams

type IngestionRecordParams struct {
	OwnerID      string
	SourceID     string
	SubmissionID string
}

type IngestionRecordRow

type IngestionRecordRow struct {
	Sequence    int64
	PayloadHash string
	ContextID   string
}

type InsertAccountUserParams

type InsertAccountUserParams struct {
	ID        string
	Name      string
	CreatedAt time.Time
}

type InsertCommentParams

type InsertCommentParams struct {
	ID        string
	ReviewID  string
	VersionID string
	FileID    string
	Data      []byte
	CreatedAt int64
}

type InsertCommitParams

type InsertCommitParams struct {
	ContextID string
	Ordinal   int32
	Oid       string
	Data      []byte
	DiffID    *string
	VersionID *string
	FileCount int64
	Additions int64
	Deletions int64
}

type InsertCommitRangeParams

type InsertCommitRangeParams struct {
	ContextID string
	Total     int64
}

type InsertContextParams

type InsertContextParams struct {
	ID            string
	OwnerID       string
	Now           time.Time
	SubmittedFrom *string
}

type InsertDeliveryParams

type InsertDeliveryParams struct {
	NotificationID string
	SubscriptionID string
	State          string
}

type InsertDiffFilesParams

type InsertDiffFilesParams struct {
	VersionID    string
	FileIds      []string
	Paths        []string
	Fingerprints []string
	Patches      [][]byte
	PatchDigests []string
}

type InsertDiffParams

type InsertDiffParams struct {
	ID        string
	OwnerID   string
	Mode      string
	CreatedAt time.Time
	ExpiresAt time.Time
}

type InsertDiffVersionParams

type InsertDiffVersionParams struct {
	ID             string
	DiffID         string
	Revision       string
	Manifest       []byte
	Source         string
	ComparisonKind string
	CreatedAt      time.Time
}

type InsertGoogleFlowParams

type InsertGoogleFlowParams struct {
	StateHash    string
	BindingHash  string
	Nonce        string
	PkceVerifier string
	InviteID     *string
	SetupHash    *string
	ExpiresAt    time.Time
}

type InsertGoogleIdentityParams

type InsertGoogleIdentityParams struct {
	Sub       string
	UserID    string
	Email     string
	UpdatedAt time.Time
}

type InsertIdentityParams

type InsertIdentityParams struct {
	OwnerID      string
	IdentityHash string
	ContextID    string
}

type InsertIdentityTokenParams

type InsertIdentityTokenParams struct {
	ID         string
	Name       string
	Purpose    string
	SecretHash string
	CreatedAt  time.Time
	ExpiresAt  time.Time
	UserID     string
}

type InsertIngestionRecordParams

type InsertIngestionRecordParams struct {
	OwnerID      string
	SourceID     string
	SubmissionID string
	PayloadHash  string
}

type InsertInviteParams

type InsertInviteParams struct {
	ID        string
	TokenHash string
	Email     string
	CreatedAt time.Time
	ExpiresAt time.Time
}

type InsertJobParams

type InsertJobParams struct {
	ID          string
	Sequence    int64
	Payload     []byte
	State       string
	AvailableAt time.Time
	ContextID   string
}

type InsertNotificationParams

type InsertNotificationParams struct {
	ID          string
	OwnerID     string
	JobID       string
	Kind        string
	Payload     []byte
	AvailableAt time.Time
}

type InsertObservationParams

type InsertObservationParams struct {
	ContextID        string
	OwnerID          string
	SourceID         string
	SubmissionID     string
	PayloadHash      string
	RepositoryID     *string
	Metadata         []byte
	StreamKey        string
	ComparisonPolicy string
}

type InsertObservationSubmissionParams

type InsertObservationSubmissionParams struct {
	OwnerID      string
	SourceID     string
	SubmissionID string
	ContextID    string
	PayloadHash  string
	Metadata     []byte
}

type InsertPushKeysParams

type InsertPushKeysParams struct {
	PublicKey  string
	PrivateKey string
	CreatedAt  time.Time
}

type InsertRemoteAccountParams

type InsertRemoteAccountParams struct {
	UserID       string
	Username     string
	PasswordHash string
}

type InsertRepositoryParams

type InsertRepositoryParams struct {
	ID            string
	OwnerID       string
	RepositoryKey string
}

type InsertScopeParams

type InsertScopeParams struct {
	ContextID string
	Mode      string
	DiffID    string
	VersionID string
}

type InsertSessionParams

type InsertSessionParams struct {
	SecretHash string
	CsrfToken  string
	ExpiresAt  time.Time
	UserID     string
	Expected   string
}

type InsertSubscriptionParams

type InsertSubscriptionParams struct {
	ID        string
	OwnerID   string
	Endpoint  string
	P256dh    string
	Auth      string
	Label     string
	CreatedAt time.Time
}

type InviteEmailLockParams

type InviteEmailLockParams struct {
	Namespace int32
	Email     string
}

type InviteRow

type InviteRow struct {
	ID        string
	Email     string
	CreatedAt time.Time
	ExpiresAt time.Time
	UsedAt    *time.Time
	UsedBy    string
	RevokedAt *time.Time
}

type InvitesRow

type InvitesRow struct {
	ID        string
	Email     string
	CreatedAt time.Time
	ExpiresAt time.Time
	UsedAt    *time.Time
	UsedBy    string
	RevokedAt *time.Time
}

type JobBySequenceRow

type JobBySequenceRow struct {
	ID           string
	SubmissionID string
	State        string
	Attempt      int32
	ContextID    string
	Detail       string
}

type LockAppSettingsRow added in v0.2.4

type LockAppSettingsRow struct {
	SignupOpen     bool
	PasswordSignup bool
}

type LockEndpointParams

type LockEndpointParams struct {
	LockClass int32
	Endpoint  string
}

type LockGitHubFollowParams

type LockGitHubFollowParams struct {
	OwnerID      string
	RepositoryID int64
}

type LockIdentityParams

type LockIdentityParams struct {
	OwnerID      string
	IdentityHash string
}

type LockStreamParams

type LockStreamParams struct {
	OwnerID   string
	StreamKey string
}

type LockStreamReviewsParams

type LockStreamReviewsParams struct {
	OwnerID   string
	StreamKey string
}

type LockTargetAccountRow added in v0.2.4

type LockTargetAccountRow struct {
	Admin    bool
	Disabled bool
}

type LoseGitHubInstallationRepositoriesParams

type LoseGitHubInstallationRepositoriesParams struct {
	InstallationID int64
	RepositoryIds  []int64
}

type Mark

type Mark struct {
	ReviewID    string
	FileID      string
	VersionID   *string
	PatchDigest string
	Data        []byte
}

type MarkGitHubPullRequestOpenedParams

type MarkGitHubPullRequestOpenedParams struct {
	RepositoryID int64
	Number       int32
}

type MarksParams

type MarksParams struct {
	Mode      string
	ContextID string
	Now       time.Time
}

type MarksRow

type MarksRow struct {
	DiffID      string
	VersionID   string
	FileID      string
	Fingerprint string
}

type MuteGitHubFollowParams

type MuteGitHubFollowParams struct {
	OwnerID      string
	RepositoryID int64
}

type NotifyParams

type NotifyParams struct {
	Channel string
	Payload string
}

type Observation

type Observation struct {
	ContextID        string
	OwnerID          string
	SourceID         string
	SubmissionID     string
	PayloadHash      string
	RepositoryID     *string
	Metadata         []byte
	StreamKey        string
	ComparisonPolicy string
}

type ObservationCommit

type ObservationCommit struct {
	ContextID string
	Ordinal   int32
	Oid       string
	Data      []byte
	DiffID    *string
	VersionID *string
	FileCount int64
	Additions int64
	Deletions int64
}

type ObservationCommitFileVersionParams

type ObservationCommitFileVersionParams struct {
	FileID    string
	OwnerID   string
	ContextID string
	Oid       string
	Now       time.Time
}

type ObservationCommitFileVersionRow

type ObservationCommitFileVersionRow struct {
	DiffID      string
	VersionID   string
	Fingerprint *string
}

type ObservationCommitManifestParams

type ObservationCommitManifestParams struct {
	OwnerID   string
	ContextID string
	Oid       string
	Now       time.Time
}

type ObservationCommitPatchParams

type ObservationCommitPatchParams struct {
	OwnerID     string
	ContextID   string
	Oid         string
	FileID      string
	Fingerprint string
	Now         time.Time
}

type ObservationCommitRange

type ObservationCommitRange struct {
	ContextID string
	Total     int64
}

type ObservationCommitTotalParams

type ObservationCommitTotalParams struct {
	OwnerID   string
	ContextID string
	Now       time.Time
}

type ObservationCommitsRow

type ObservationCommitsRow struct {
	Data      []byte
	FileCount int64
	Additions int64
	Deletions int64
}

type ObservationFileVersionParams

type ObservationFileVersionParams struct {
	FileID    string
	OwnerID   string
	ContextID string
	Mode      string
	Now       time.Time
}

type ObservationFileVersionRow

type ObservationFileVersionRow struct {
	DiffID      string
	VersionID   string
	Fingerprint *string
}

type ObservationIdentity

type ObservationIdentity struct {
	OwnerID      string
	IdentityHash string
	ContextID    string
}

type ObservationPatchParams

type ObservationPatchParams struct {
	OwnerID     string
	ContextID   string
	Mode        string
	FileID      string
	Fingerprint string
	Now         time.Time
}

type ObservationRepository

type ObservationRepository struct {
	ID            string
	OwnerID       string
	RepositoryKey string
}

type ObservationRepositoryParams

type ObservationRepositoryParams struct {
	OwnerID   string
	ContextID string
	Now       time.Time
}

type ObservationScope

type ObservationScope struct {
	ContextID string
	Mode      string
	DiffID    string
	VersionID string
}

type ObservationScopesRow

type ObservationScopesRow struct {
	Mode   string
	DiffID string
}

type ObservationSession

type ObservationSession struct {
	ContextID       string
	OwnerID         string
	SourceID        string
	Harness         string
	SessionID       string
	FirstObservedAt int64
	LastObservedAt  int64
}

type ObservationSnapshotParams

type ObservationSnapshotParams struct {
	OwnerID   string
	ContextID string
	Mode      string
	Now       time.Time
}

type ObservationSnapshotRow

type ObservationSnapshotRow struct {
	Manifest []byte
	Metadata []byte
	Modes    []string
}

type ObservationStreamHead

type ObservationStreamHead struct {
	OwnerID          string
	SourceID         string
	RepositoryKey    string
	CheckoutKey      string
	Branch           string
	ComparisonPolicy string
	ContextID        string
	CollectedAt      int64
	ArrivalSequence  int64
}

type ObservationSubmission

type ObservationSubmission struct {
	OwnerID      string
	SourceID     string
	SubmissionID string
	ContextID    string
	PayloadHash  string
	Metadata     []byte
}

type OwnedJobParams

type OwnedJobParams struct {
	OwnerID string
	ID      string
}

type OwnedJobRow

type OwnedJobRow struct {
	ID           string
	SubmissionID string
	State        string
	Attempt      int32
	ContextID    string
	Detail       string
}

type PasswordReset added in v0.2.4

type PasswordReset struct {
	UserID    string
	TokenHash string
	ExpiresAt time.Time
}

type PasswordResetParams added in v0.2.4

type PasswordResetParams struct {
	TokenHash string
	Now       time.Time
}

type PasswordResetRow added in v0.2.4

type PasswordResetRow struct {
	UserID       string
	Username     string
	Admin        bool
	Method       string
	PasswordHash string
}

type PendingAdminSetupParams added in v0.2.4

type PendingAdminSetupParams struct {
	TokenHash string
	Now       time.Time
}

type PendingInviteParams

type PendingInviteParams struct {
	TokenHash string
	Now       time.Time
}

type PendingInviteRow

type PendingInviteRow struct {
	ID        string
	Email     string
	CreatedAt time.Time
	ExpiresAt time.Time
	UsedAt    *time.Time
	UsedBy    string
	RevokedAt *time.Time
}

type PushDelivery

type PushDelivery struct {
	NotificationID string
	SubscriptionID string
	State          string
}

type PushKey

type PushKey struct {
	Singleton  bool
	PublicKey  string
	PrivateKey string
	CreatedAt  time.Time
}

type PushKeysRow

type PushKeysRow struct {
	PublicKey  string
	PrivateKey string
}

type PushNotification

type PushNotification struct {
	ID          string
	OwnerID     string
	JobID       string
	Kind        string
	Payload     []byte
	State       string
	Attempt     int32
	AvailableAt time.Time
	CreatedAt   time.Time
	LeaseToken  string
	LeaseUntil  time.Time
}

type PushSubscription

type PushSubscription struct {
	ID            string
	OwnerID       string
	Endpoint      string
	P256dh        string
	Auth          string
	Label         string
	CreatedAt     time.Time
	LastSuccessAt *time.Time
}

type PutAdminSetupParams

type PutAdminSetupParams struct {
	TokenHash string
	ExpiresAt time.Time
}

type PutAppSettingsParams added in v0.2.4

type PutAppSettingsParams struct {
	SignupOpen     bool
	PasswordSignup bool
	UpdatedAt      time.Time
	UpdatedBy      string
}

type PutGitHubConnectionParams

type PutGitHubConnectionParams struct {
	OwnerID          string
	UserID           int64
	Login            string
	AccessToken      []byte
	AccessExpiresAt  time.Time
	RefreshToken     []byte
	RefreshExpiresAt time.Time
	Status           string
	ConnectedAt      time.Time
}

type PutGitHubFollowParams

type PutGitHubFollowParams struct {
	OwnerID        string
	RepositoryID   int64
	InstallationID int64
	FullName       string
	Status         string
	VerifiedAt     time.Time
	CreatedAt      time.Time
}

type PutGitHubOAuthStateParams

type PutGitHubOAuthStateParams struct {
	StateHash string
	OwnerID   string
	ExpiresAt time.Time
}

type PutPasswordResetParams added in v0.2.4

type PutPasswordResetParams struct {
	UserID    string
	TokenHash string
	ExpiresAt time.Time
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AccountPassword

func (q *Queries) AccountPassword(ctx context.Context, username string) (AccountPasswordRow, error)

func (*Queries) AccountPasswordByID

func (q *Queries) AccountPasswordByID(ctx context.Context, userID string) (AccountPasswordByIDRow, error)

func (*Queries) AccountSummaries

func (q *Queries) AccountSummaries(ctx context.Context) ([]AccountSummariesRow, error)

func (*Queries) ActiveJobUsage

func (q *Queries) ActiveJobUsage(ctx context.Context) (ActiveJobUsageRow, error)

func (*Queries) AdminExists

func (q *Queries) AdminExists(ctx context.Context) (bool, error)

func (*Queries) AdvanceStreamHead

func (q *Queries) AdvanceStreamHead(ctx context.Context, arg AdvanceStreamHeadParams) error

Equal collection times use arrival order. Retries bypass this write.

func (*Queries) AppSettings added in v0.2.4

func (q *Queries) AppSettings(ctx context.Context) (AppSettingsRow, error)

func (*Queries) BindSubmission

func (q *Queries) BindSubmission(ctx context.Context, arg BindSubmissionParams) error

func (*Queries) ClaimGitHubRefresh

func (q *Queries) ClaimGitHubRefresh(ctx context.Context, arg ClaimGitHubRefreshParams) (ClaimGitHubRefreshRow, error)

SKIP LOCKED lets replicas claim distinct pull requests concurrently; a row another replica claimed meanwhile fails the recheck and is skipped.

func (*Queries) ClaimJob

func (q *Queries) ClaimJob(ctx context.Context, arg ClaimJobParams) (ClaimJobRow, error)

The oldest available job; SKIP LOCKED lets concurrent workers claim others.

func (*Queries) ClaimNotifications

func (q *Queries) ClaimNotifications(ctx context.Context, arg ClaimNotificationsParams) ([]ClaimNotificationsRow, error)

SKIP LOCKED lets replicas claim distinct notifications concurrently. The linked job is read through its owner's ingestion record, so a notification never resolves another account's publication.

func (*Queries) Comments

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

func (*Queries) CompleteGitHubRefresh

func (q *Queries) CompleteGitHubRefresh(ctx context.Context, arg CompleteGitHubRefreshParams) (int64, error)

func (*Queries) CompleteJob

func (q *Queries) CompleteJob(ctx context.Context, arg CompleteJobParams) (int64, error)

func (*Queries) ConsumeAdminSetup

func (q *Queries) ConsumeAdminSetup(ctx context.Context, arg ConsumeAdminSetupParams) (int64, error)

func (*Queries) ConsumePasswordReset added in v0.2.4

func (q *Queries) ConsumePasswordReset(ctx context.Context, arg ConsumePasswordResetParams) (string, error)

func (*Queries) ContextExpiry

func (q *Queries) ContextExpiry(ctx context.Context, arg ContextExpiryParams) (*time.Time, error)

func (*Queries) ContextForDelete

func (q *Queries) ContextForDelete(ctx context.Context, arg ContextForDeleteParams) (ContextForDeleteRow, error)

Deletion locks the context first, as reuse and pruning do.

func (*Queries) ContextStream

func (q *Queries) ContextStream(ctx context.Context, arg ContextStreamParams) (ContextStreamRow, error)

The context's expiry and its current stream head, matched as the catalog matches observations to heads.

func (*Queries) CountAuthAttempt

func (q *Queries) CountAuthAttempt(ctx context.Context, arg CountAuthAttemptParams) (int32, error)

One statement counts the attempt: a client's window starts at its first attempt and restarts with the first attempt after it ends.

func (*Queries) DeleteAccountJobs

func (q *Queries) DeleteAccountJobs(ctx context.Context, ownerID string) error

func (*Queries) DeleteAccountSessions

func (q *Queries) DeleteAccountSessions(ctx context.Context, userID string) error

func (*Queries) DeleteAccountTokens

func (q *Queries) DeleteAccountTokens(ctx context.Context, userID string) error

func (*Queries) DeleteAccountUser

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

func (*Queries) DeleteContextDiffs

func (q *Queries) DeleteContextDiffs(ctx context.Context, arg DeleteContextDiffsParams) error

func (*Queries) DeleteDiff

func (q *Queries) DeleteDiff(ctx context.Context, arg DeleteDiffParams) error

func (*Queries) DeleteGitHubConnection

func (q *Queries) DeleteGitHubConnection(ctx context.Context, ownerID string) error

Follows and mutes cascade with their connection.

func (*Queries) DeleteGitHubFollow

func (q *Queries) DeleteGitHubFollow(ctx context.Context, arg DeleteGitHubFollowParams) error

func (*Queries) DeleteIdentityToken

func (q *Queries) DeleteIdentityToken(ctx context.Context, arg DeleteIdentityTokenParams) (int64, error)

func (*Queries) DeleteOwnedSubscription

func (q *Queries) DeleteOwnedSubscription(ctx context.Context, arg DeleteOwnedSubscriptionParams) (int64, error)

func (*Queries) DeleteSession

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

func (*Queries) DeleteStreamComments

func (q *Queries) DeleteStreamComments(ctx context.Context, arg DeleteStreamCommentsParams) (int64, error)

func (*Queries) DeleteSubscriptionByID

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

func (*Queries) DeleteVisibleMarks

func (q *Queries) DeleteVisibleMarks(ctx context.Context, arg DeleteVisibleMarksParams) error

Removes only marks visible in this context; a null file clears the scope.

func (*Queries) DisableAccount

func (q *Queries) DisableAccount(ctx context.Context, arg DisableAccountParams) error

func (*Queries) EmailLinked

func (q *Queries) EmailLinked(ctx context.Context, email string) (bool, error)

func (*Queries) EnableAccount

func (q *Queries) EnableAccount(ctx context.Context, userID string) error

func (*Queries) EndStream

func (q *Queries) EndStream(ctx context.Context, arg EndStreamParams) error

Review state ends with its stream's last observation.

func (*Queries) EndStreams

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

Review state ends with its stream's last observation.

func (*Queries) EnsureReview

func (q *Queries) EnsureReview(ctx context.Context, arg EnsureReviewParams) error

func (*Queries) ExtendObservation

func (q *Queries) ExtendObservation(ctx context.Context, arg ExtendObservationParams) error

func (*Queries) FailJob

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

func (*Queries) FinishNotification

func (q *Queries) FinishNotification(ctx context.Context, arg FinishNotificationParams) (int64, error)

func (*Queries) ForgetIdentity

func (q *Queries) ForgetIdentity(ctx context.Context, arg ForgetIdentityParams) error

func (*Queries) GitHubConnection

func (q *Queries) GitHubConnection(ctx context.Context, ownerID string) (GithubConnection, error)

func (*Queries) GitHubConnections

func (q *Queries) GitHubConnections(ctx context.Context) ([]GithubConnection, error)

func (*Queries) GitHubFollows

func (q *Queries) GitHubFollows(ctx context.Context, ownerID string) ([]GitHubFollowsRow, error)

func (*Queries) GitHubKnownOpen

func (q *Queries) GitHubKnownOpen(ctx context.Context, repositoryID int64) ([]int32, error)

func (*Queries) GitHubLeased

func (q *Queries) GitHubLeased(ctx context.Context, arg GitHubLeasedParams) (GitHubLeasedRow, error)

func (*Queries) GitHubPullRequestHead

func (q *Queries) GitHubPullRequestHead(ctx context.Context, arg GitHubPullRequestHeadParams) (GitHubPullRequestHeadRow, error)

func (*Queries) GitHubReconcileUnlock

func (q *Queries) GitHubReconcileUnlock(ctx context.Context, key int64) (bool, error)

func (*Queries) GitHubRepositoryFollows

func (q *Queries) GitHubRepositoryFollows(ctx context.Context, repositoryID int64) ([]GitHubRepositoryFollowsRow, error)

func (*Queries) GoogleAccount

func (q *Queries) GoogleAccount(ctx context.Context, sub string) (GoogleAccountRow, error)

func (*Queries) GoogleEmail

func (q *Queries) GoogleEmail(ctx context.Context, userID string) (string, error)

func (*Queries) GrantAdmin added in v0.2.4

func (q *Queries) GrantAdmin(ctx context.Context, userID string) error

func (*Queries) HoldNotificationLease

func (q *Queries) HoldNotificationLease(ctx context.Context, arg HoldNotificationLeaseParams) (bool, error)

Holds the claim until the caller's transaction commits, so no replica reclaims the notification meanwhile.

func (*Queries) IdentityAccounts

func (q *Queries) IdentityAccounts(ctx context.Context) ([]IdentityAccountsRow, error)

func (*Queries) IdentityLock

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

Accounts read from remote_accounts aliased as a. Ordering is bytewise, as in SQLite, independent of the database collation.

func (*Queries) IdentityTokens

func (q *Queries) IdentityTokens(ctx context.Context, userID string) ([]IdentityTokensRow, error)

func (*Queries) IngestionRecord

func (q *Queries) IngestionRecord(ctx context.Context, arg IngestionRecordParams) (IngestionRecordRow, error)

func (*Queries) InsertAccountUser

func (q *Queries) InsertAccountUser(ctx context.Context, arg InsertAccountUserParams) error

func (*Queries) InsertAdmin

func (q *Queries) InsertAdmin(ctx context.Context, userID string) error

func (*Queries) InsertComment

func (q *Queries) InsertComment(ctx context.Context, arg InsertCommentParams) (int64, error)

func (*Queries) InsertCommit

func (q *Queries) InsertCommit(ctx context.Context, arg InsertCommitParams) error

func (*Queries) InsertCommitRange

func (q *Queries) InsertCommitRange(ctx context.Context, arg InsertCommitRangeParams) error

func (*Queries) InsertContext

func (q *Queries) InsertContext(ctx context.Context, arg InsertContextParams) error

func (*Queries) InsertDelivery

func (q *Queries) InsertDelivery(ctx context.Context, arg InsertDeliveryParams) error

A device removed or moved to another account while sending has no outcome to keep.

func (*Queries) InsertDiff

func (q *Queries) InsertDiff(ctx context.Context, arg InsertDiffParams) error

func (*Queries) InsertDiffFiles

func (q *Queries) InsertDiffFiles(ctx context.Context, arg InsertDiffFilesParams) error

func (*Queries) InsertDiffVersion

func (q *Queries) InsertDiffVersion(ctx context.Context, arg InsertDiffVersionParams) error

func (*Queries) InsertGoogleFlow

func (q *Queries) InsertGoogleFlow(ctx context.Context, arg InsertGoogleFlowParams) error

func (*Queries) InsertGoogleIdentity

func (q *Queries) InsertGoogleIdentity(ctx context.Context, arg InsertGoogleIdentityParams) (int64, error)

func (*Queries) InsertIdentity

func (q *Queries) InsertIdentity(ctx context.Context, arg InsertIdentityParams) error

func (*Queries) InsertIdentityToken

func (q *Queries) InsertIdentityToken(ctx context.Context, arg InsertIdentityTokenParams) (int64, error)

func (*Queries) InsertIngestionRecord

func (q *Queries) InsertIngestionRecord(ctx context.Context, arg InsertIngestionRecordParams) error

func (*Queries) InsertInvite

func (q *Queries) InsertInvite(ctx context.Context, arg InsertInviteParams) error

func (*Queries) InsertJob

func (q *Queries) InsertJob(ctx context.Context, arg InsertJobParams) error

func (*Queries) InsertNotification

func (q *Queries) InsertNotification(ctx context.Context, arg InsertNotificationParams) error

func (*Queries) InsertObservation

func (q *Queries) InsertObservation(ctx context.Context, arg InsertObservationParams) error

func (*Queries) InsertObservationSubmission

func (q *Queries) InsertObservationSubmission(ctx context.Context, arg InsertObservationSubmissionParams) error

func (*Queries) InsertPushKeys

func (q *Queries) InsertPushKeys(ctx context.Context, arg InsertPushKeysParams) error

func (*Queries) InsertRemoteAccount

func (q *Queries) InsertRemoteAccount(ctx context.Context, arg InsertRemoteAccountParams) (int64, error)

func (*Queries) InsertRepository

func (q *Queries) InsertRepository(ctx context.Context, arg InsertRepositoryParams) error

func (*Queries) InsertScope

func (q *Queries) InsertScope(ctx context.Context, arg InsertScopeParams) error

func (*Queries) InsertSession

func (q *Queries) InsertSession(ctx context.Context, arg InsertSessionParams) (int64, error)

func (*Queries) InsertSubscription

func (q *Queries) InsertSubscription(ctx context.Context, arg InsertSubscriptionParams) error

func (*Queries) Invite

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

func (*Queries) InviteEmailLock

func (q *Queries) InviteEmailLock(ctx context.Context, arg InviteEmailLockParams) error

Serializes invitation and acceptance per email; the two-key form keeps these locks apart from single-key ones.

func (*Queries) Invites

func (q *Queries) Invites(ctx context.Context) ([]InvitesRow, error)

func (*Queries) JobBySequence

func (q *Queries) JobBySequence(ctx context.Context, sequence int64) (JobBySequenceRow, error)

func (*Queries) LockAppSettings added in v0.2.4

func (q *Queries) LockAppSettings(ctx context.Context) (LockAppSettingsRow, error)

Holds the settings against a concurrent change until the account commits.

func (*Queries) LockEndingStreams

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

Streams left without observations, locked in key order before ending them.

func (*Queries) LockEndpoint

func (q *Queries) LockEndpoint(ctx context.Context, arg LockEndpointParams) error

Serializes registrations of one endpoint, including its first insert.

func (*Queries) LockExpiredContexts

func (q *Queries) LockExpiredContexts(ctx context.Context, now time.Time) error

Pruning locks contexts before their diffs, in the order deletion and reuse lock them, so concurrent writers cannot deadlock with it.

func (*Queries) LockGitHubFollow

func (q *Queries) LockGitHubFollow(ctx context.Context, arg LockGitHubFollowParams) (bool, error)

Holds the follow against deletion until the mute change commits.

func (*Queries) LockIdentity

func (q *Queries) LockIdentity(ctx context.Context, arg LockIdentityParams) error

Advisory lock namespaces (two-key form; distinct from single-key schema locks): 7469101 serializes an owner's reuse decisions per content identity; 7469102 serializes adding observations to, and ending, a review stream.

func (*Queries) LockSessionAccount

func (q *Queries) LockSessionAccount(ctx context.Context, userID string) error

Conflicts with password replacement, disable and delete, so issuance reads the account only after they commit and they see the issued session.

func (*Queries) LockStream

func (q *Queries) LockStream(ctx context.Context, arg LockStreamParams) error

func (*Queries) LockStreamReviews

func (q *Queries) LockStreamReviews(ctx context.Context, arg LockStreamReviewsParams) error

Writers key-share lock reviews before snapshot versions; deletion takes the reviews first so ending a stream cannot deadlock with them.

func (*Queries) LockTargetAccount

func (q *Queries) LockTargetAccount(ctx context.Context, userID string) (LockTargetAccountRow, error)

Locks the account and its owner row against credential issuance and new owned data.

func (*Queries) LoseGitHubInstallation

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

func (*Queries) LoseGitHubInstallationRepositories

func (q *Queries) LoseGitHubInstallationRepositories(ctx context.Context, arg LoseGitHubInstallationRepositoriesParams) error

func (*Queries) LoseGitHubUserFollows

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

func (*Queries) MarkGitHubPullRequestOpened

func (q *Queries) MarkGitHubPullRequestOpened(ctx context.Context, arg MarkGitHubPullRequestOpenedParams) error

func (*Queries) Marks

func (q *Queries) Marks(ctx context.Context, arg MarksParams) ([]MarksRow, error)

Stream marks whose file patch is unchanged in this context, projected onto its snapshot.

func (*Queries) MuteGitHubFollow

func (q *Queries) MuteGitHubFollow(ctx context.Context, arg MuteGitHubFollowParams) error

func (*Queries) Notify

func (q *Queries) Notify(ctx context.Context, arg NotifyParams) error

Listeners receive the payload only when the surrounding transaction commits.

func (*Queries) ObservationCommitManifest

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

Merge commits and commits outside the observation are not found.

func (*Queries) ObservationCommitPatch

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

func (*Queries) ObservationCommitTotal

func (q *Queries) ObservationCommitTotal(ctx context.Context, arg ObservationCommitTotalParams) (*int64, error)

func (*Queries) ObservationCommits

func (q *Queries) ObservationCommits(ctx context.Context, contextID string) ([]ObservationCommitsRow, error)

func (*Queries) ObservationFileVersion

func (q *Queries) ObservationFileVersion(ctx context.Context, arg ObservationFileVersionParams) (ObservationFileVersionRow, error)

Missing files retain the scope identity, so callers reject stale scope references before file errors.

func (*Queries) ObservationPatch

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

func (*Queries) ObservationRepository

func (q *Queries) ObservationRepository(ctx context.Context, arg ObservationRepositoryParams) (*string, error)

func (*Queries) ObservationScopes

func (q *Queries) ObservationScopes(ctx context.Context, contextID string) ([]ObservationScopesRow, error)

func (*Queries) ObservationSnapshot

func (q *Queries) ObservationSnapshot(ctx context.Context, arg ObservationSnapshotParams) (ObservationSnapshotRow, error)

func (*Queries) OtherEnabledAdmin added in v0.2.4

func (q *Queries) OtherEnabledAdmin(ctx context.Context, userID string) (bool, error)

func (*Queries) OwnedJob

func (q *Queries) OwnedJob(ctx context.Context, arg OwnedJobParams) (OwnedJobRow, error)

func (*Queries) PasswordReset added in v0.2.4

func (q *Queries) PasswordReset(ctx context.Context, arg PasswordResetParams) (PasswordResetRow, error)

func (*Queries) PendingAdminSetup added in v0.2.4

func (q *Queries) PendingAdminSetup(ctx context.Context, arg PendingAdminSetupParams) (bool, error)

func (*Queries) PendingInvite

func (q *Queries) PendingInvite(ctx context.Context, arg PendingInviteParams) (PendingInviteRow, error)

func (*Queries) PruneAuthAttempts

func (q *Queries) PruneAuthAttempts(ctx context.Context, expired time.Time) error

Skips rows other statements hold, so pruning never waits or deadlocks.

func (*Queries) PruneBrowserSessions

func (q *Queries) PruneBrowserSessions(ctx context.Context, expiresAt time.Time) error

Skips sessions another transaction holds, so cleanup never waits or deadlocks.

func (*Queries) PruneExpiredDiffs

func (q *Queries) PruneExpiredDiffs(ctx context.Context, expiresAt *time.Time) error

func (*Queries) PruneExpiredObservationDiffs

func (q *Queries) PruneExpiredObservationDiffs(ctx context.Context, expiresAt *time.Time) error

Every scope and commit diff of an expired observation ends with its anchor.

func (*Queries) PruneFinishedNotifications

func (q *Queries) PruneFinishedNotifications(ctx context.Context, createdAt time.Time) error

func (*Queries) PruneGitHubDeliveries

func (q *Queries) PruneGitHubDeliveries(ctx context.Context, receivedAt time.Time) error

func (*Queries) PruneGitHubStates

func (q *Queries) PruneGitHubStates(ctx context.Context, expiresAt time.Time) error

func (*Queries) PruneGoogleFlows

func (q *Queries) PruneGoogleFlows(ctx context.Context, expiresAt time.Time) error

Skips flows being taken, so cleanup never waits on a callback.

func (*Queries) PrunePasswordResets added in v0.2.4

func (q *Queries) PrunePasswordResets(ctx context.Context, expiresAt time.Time) error

func (*Queries) PushKeys

func (q *Queries) PushKeys(ctx context.Context) (PushKeysRow, error)

func (*Queries) PutAdminSetup

func (q *Queries) PutAdminSetup(ctx context.Context, arg PutAdminSetupParams) (int64, error)

func (*Queries) PutAppSettings added in v0.2.4

func (q *Queries) PutAppSettings(ctx context.Context, arg PutAppSettingsParams) error

func (*Queries) PutGitHubConnection

func (q *Queries) PutGitHubConnection(ctx context.Context, arg PutGitHubConnectionParams) error

func (*Queries) PutGitHubFollow

func (q *Queries) PutGitHubFollow(ctx context.Context, arg PutGitHubFollowParams) error

Mutes are separate rows, so a put leaves them unchanged.

func (*Queries) PutGitHubOAuthState

func (q *Queries) PutGitHubOAuthState(ctx context.Context, arg PutGitHubOAuthStateParams) error

func (*Queries) PutPasswordReset added in v0.2.4

func (q *Queries) PutPasswordReset(ctx context.Context, arg PutPasswordResetParams) error

func (*Queries) RecordGitHubDelivery

func (q *Queries) RecordGitHubDelivery(ctx context.Context, arg RecordGitHubDeliveryParams) error

func (*Queries) RecordGitHubLease

func (q *Queries) RecordGitHubLease(ctx context.Context, arg RecordGitHubLeaseParams) (int64, error)

func (*Queries) RecordGitHubPullRequestHead

func (q *Queries) RecordGitHubPullRequestHead(ctx context.Context, arg RecordGitHubPullRequestHeadParams) error

func (*Queries) RecordGoogleEmail

func (q *Queries) RecordGoogleEmail(ctx context.Context, arg RecordGoogleEmailParams) error

func (*Queries) RecordSubscriptionSuccess

func (q *Queries) RecordSubscriptionSuccess(ctx context.Context, arg RecordSubscriptionSuccessParams) error

func (*Queries) RefreshContext

func (q *Queries) RefreshContext(ctx context.Context, arg RefreshContextParams) error

func (*Queries) ReleaseGitHubRefresh

func (q *Queries) ReleaseGitHubRefresh(ctx context.Context, arg ReleaseGitHubRefreshParams) (int64, error)

func (*Queries) RenewJob

func (q *Queries) RenewJob(ctx context.Context, arg RenewJobParams) (int64, error)

func (*Queries) ReplacePassword

func (q *Queries) ReplacePassword(ctx context.Context, arg ReplacePasswordParams) (int64, error)

func (*Queries) RepositoryID

func (q *Queries) RepositoryID(ctx context.Context, arg RepositoryIDParams) (string, error)

func (*Queries) RequestGitHubRefresh

func (q *Queries) RequestGitHubRefresh(ctx context.Context, arg RequestGitHubRefreshParams) error

func (*Queries) ResolveIdentityToken

func (q *Queries) ResolveIdentityToken(ctx context.Context, arg ResolveIdentityTokenParams) (ResolveIdentityTokenRow, error)

Records the latest use; last_used_at never moves backwards.

func (*Queries) ResolveSession

func (q *Queries) ResolveSession(ctx context.Context, arg ResolveSessionParams) (ResolveSessionRow, error)

func (*Queries) RetryJob

func (q *Queries) RetryJob(ctx context.Context, arg RetryJobParams) (int64, error)

func (*Queries) RetryNotification

func (q *Queries) RetryNotification(ctx context.Context, arg RetryNotificationParams) (int64, error)

func (*Queries) ReusableObservation

func (q *Queries) ReusableObservation(ctx context.Context, arg ReusableObservationParams) (string, error)

The context row lock orders reuse before or after deletion and pruning.

func (*Queries) RevokeAdmin added in v0.2.4

func (q *Queries) RevokeAdmin(ctx context.Context, userID string) error

func (*Queries) RevokeGitHubUserConnections

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

func (*Queries) RevokeInvite

func (q *Queries) RevokeInvite(ctx context.Context, arg RevokeInviteParams) (int64, error)

func (*Queries) RevokePendingInvites

func (q *Queries) RevokePendingInvites(ctx context.Context, arg RevokePendingInvitesParams) error

func (*Queries) SchemaFloor

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

func (*Queries) ScopeFileDigest

func (q *Queries) ScopeFileDigest(ctx context.Context, arg ScopeFileDigestParams) (string, error)

func (*Queries) ScopeReview

func (q *Queries) ScopeReview(ctx context.Context, arg ScopeReviewParams) (ScopeReviewRow, error)

Resolves a retained context's scope to its stream review. The key-share lock keeps the review until this write commits, or reports it ended.

func (*Queries) SeenGitHubDelivery

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

func (*Queries) StoredComment

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

func (*Queries) StoredVersion

func (q *Queries) StoredVersion(ctx context.Context, arg StoredVersionParams) (StoredVersionRow, error)

func (*Queries) SubscriptionByEndpoint

func (q *Queries) SubscriptionByEndpoint(ctx context.Context, endpoint string) (PushSubscription, error)

func (*Queries) Subscriptions

func (q *Queries) Subscriptions(ctx context.Context, ownerID string) ([]PushSubscription, error)

func (*Queries) TakeGitHubOAuthState

func (q *Queries) TakeGitHubOAuthState(ctx context.Context, arg TakeGitHubOAuthStateParams) (string, error)

func (*Queries) TakeGoogleFlow

func (q *Queries) TakeGoogleFlow(ctx context.Context, arg TakeGoogleFlowParams) (TakeGoogleFlowRow, error)

func (*Queries) TryGitHubReconcileLock

func (q *Queries) TryGitHubReconcileLock(ctx context.Context, key int64) (bool, error)

Session-level: held across reconciliation's GitHub calls without a transaction.

func (*Queries) TryPruneLock

func (q *Queries) TryPruneLock(ctx context.Context, key int64) (bool, error)

func (*Queries) Undelivered

func (q *Queries) Undelivered(ctx context.Context, id string) ([]PushSubscription, error)

func (*Queries) UnmuteGitHubFollow

func (q *Queries) UnmuteGitHubFollow(ctx context.Context, arg UnmuteGitHubFollowParams) error

func (*Queries) UpdateComment

func (q *Queries) UpdateComment(ctx context.Context, arg UpdateCommentParams) (int64, error)

Pruned snapshot versions leave the reference in data only.

func (*Queries) UpdateSubscription

func (q *Queries) UpdateSubscription(ctx context.Context, arg UpdateSubscriptionParams) error

func (*Queries) UpsertAgentSession

func (q *Queries) UpsertAgentSession(ctx context.Context, arg UpsertAgentSessionParams) error

Names follow collection order; unnamed observations keep the last name.

func (*Queries) UpsertMark

func (q *Queries) UpsertMark(ctx context.Context, arg UpsertMarkParams) error

func (*Queries) UpsertObservationSession

func (q *Queries) UpsertObservationSession(ctx context.Context, arg UpsertObservationSessionParams) error

func (*Queries) UseInvite

func (q *Queries) UseInvite(ctx context.Context, arg UseInviteParams) (int64, error)

func (*Queries) UsePasswordInvite added in v0.2.4

func (q *Queries) UsePasswordInvite(ctx context.Context, arg UsePasswordInviteParams) (int64, error)

func (*Queries) VersionInDiff

func (q *Queries) VersionInDiff(ctx context.Context, arg VersionInDiffParams) (int64, error)

func (*Queries) WithTx

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

type RecordGitHubDeliveryParams

type RecordGitHubDeliveryParams struct {
	ID         string
	Event      string
	ReceivedAt time.Time
}

type RecordGitHubLeaseParams

type RecordGitHubLeaseParams struct {
	Leased       []byte
	RepositoryID int64
	Number       int32
	Token        string
	Now          time.Time
}

type RecordGitHubPullRequestHeadParams

type RecordGitHubPullRequestHeadParams struct {
	RepositoryID int64
	Number       int32
	HeadSha      string
}

type RecordGoogleEmailParams

type RecordGoogleEmailParams struct {
	Email string
	Now   time.Time
	Sub   string
}

type RecordSubscriptionSuccessParams

type RecordSubscriptionSuccessParams struct {
	LastSuccessAt time.Time
	ID            string
}

type RefreshContextParams

type RefreshContextParams struct {
	Now time.Time
	ID  string
}

type ReleaseGitHubRefreshParams

type ReleaseGitHubRefreshParams struct {
	RetryAt      time.Time
	Detail       string
	RepositoryID int64
	Number       int32
	Token        string
}

type RemoteAccount

type RemoteAccount struct {
	UserID       string
	Username     string
	PasswordHash string
}

type RenewJobParams

type RenewJobParams struct {
	LeaseUntil time.Time
	ID         string
	LeaseToken string
	Now        time.Time
}

type ReplacePasswordParams

type ReplacePasswordParams struct {
	Replacement string
	UserID      string
	Expected    string
}

type RepositoryIDParams

type RepositoryIDParams struct {
	OwnerID       string
	RepositoryKey string
}

type RequestGitHubRefreshParams

type RequestGitHubRefreshParams struct {
	RepositoryID   int64
	Number         int32
	InstallationID int64
	FullName       string
	RetentionRun   string
	RequestedAt    time.Time
}

type ResolveIdentityTokenParams

type ResolveIdentityTokenParams struct {
	Now        time.Time
	SecretHash string
}

type ResolveIdentityTokenRow

type ResolveIdentityTokenRow struct {
	UserID    string
	Username  string
	Admin     bool
	Method    string
	Purpose   string
	ExpiresAt time.Time
}

type ResolveSessionParams

type ResolveSessionParams struct {
	SecretHash string
	Now        time.Time
}

type ResolveSessionRow

type ResolveSessionRow struct {
	UserID    string
	Username  string
	Admin     bool
	Method    string
	CsrfToken string
	ExpiresAt time.Time
}

type RetryJobParams

type RetryJobParams struct {
	AvailableAt time.Time
	Detail      string
	ID          string
	LeaseToken  string
	Now         time.Time
}

type RetryNotificationParams

type RetryNotificationParams struct {
	Attempt     int32
	AvailableAt time.Time
	ID          string
	LeaseToken  string
}

type ReusableObservationParams

type ReusableObservationParams struct {
	OwnerID      string
	IdentityHash string
	Now          time.Time
}

type Review

type Review struct {
	ID        string
	OwnerID   string
	StreamKey string
	Mode      string
}

type RevokeInviteParams

type RevokeInviteParams struct {
	At time.Time
	ID string
}

type RevokePendingInvitesParams

type RevokePendingInvitesParams struct {
	At    time.Time
	Email string
}

type SchemaCompatibility

type SchemaCompatibility struct {
	Singleton bool
	Floor     int64
}

type ScopeFileDigestParams

type ScopeFileDigestParams struct {
	ContextID string
	Mode      string
	FileID    string
}

type ScopeReviewParams

type ScopeReviewParams struct {
	Mode      string
	ContextID string
	Now       time.Time
}

type ScopeReviewRow

type ScopeReviewRow struct {
	DiffID   string
	ReviewID string
}

type StoredCommentParams

type StoredCommentParams struct {
	ID       string
	ReviewID string
}

type StoredVersionParams

type StoredVersionParams struct {
	OwnerID   string
	DiffID    string
	VersionID string
	Now       time.Time
}

type StoredVersionRow

type StoredVersionRow struct {
	Manifest []byte
	Metadata []byte
	Modes    []string
}

type TakeGitHubOAuthStateParams

type TakeGitHubOAuthStateParams struct {
	StateHash string
	Now       time.Time
}

type TakeGoogleFlowParams

type TakeGoogleFlowParams struct {
	StateHash string
	Now       time.Time
}

type TakeGoogleFlowRow

type TakeGoogleFlowRow struct {
	BindingHash  string
	Nonce        string
	PkceVerifier string
	InviteID     *string
	SetupHash    *string
	ExpiresAt    time.Time
}

type UnmuteGitHubFollowParams

type UnmuteGitHubFollowParams struct {
	OwnerID      string
	RepositoryID int64
}

type UpdateCommentParams

type UpdateCommentParams struct {
	VersionID string
	FileID    string
	Data      []byte
	ID        string
	ReviewID  string
}

type UpdateSubscriptionParams

type UpdateSubscriptionParams struct {
	ID     string
	P256dh string
	Auth   string
	Label  string
}

type UpsertAgentSessionParams

type UpsertAgentSessionParams struct {
	OwnerID   string
	SourceID  string
	Harness   string
	SessionID string
	Name      string
	NamedAt   int64
}

type UpsertMarkParams

type UpsertMarkParams struct {
	ReviewID    string
	FileID      string
	VersionID   *string
	PatchDigest string
	Data        []byte
}

type UpsertObservationSessionParams

type UpsertObservationSessionParams struct {
	ContextID  string
	OwnerID    string
	SourceID   string
	Harness    string
	SessionID  string
	ObservedAt int64
}

type UseInviteParams

type UseInviteParams struct {
	Now    time.Time
	UserID string
	ID     string
	Sub    string
}

type UsePasswordInviteParams added in v0.2.4

type UsePasswordInviteParams struct {
	Now    time.Time
	UserID string
	ID     string
}

type User

type User struct {
	ID        string
	Name      string
	CreatedAt time.Time
}

type VersionInDiffParams

type VersionInDiffParams struct {
	ID     string
	DiffID string
}

Jump to

Keyboard shortcuts

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