dbsqlc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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 CliCredential

type CliCredential struct {
	ID         string
	UserID     string
	Name       string
	TokenHash  string
	LastUsedAt pgtype.Timestamptz
	CreatedAt  pgtype.Timestamptz
	RevokedAt  pgtype.Timestamptz
}

type Comment

type Comment struct {
	ID                 string
	DocumentID         string
	CreatedOnVersionID string
	AuthorType         string
	AuthorID           string
	AuthorEmail        string
	AuthorName         string
	Body               string
	SelectedText       string
	AnchorJson         []byte
	Status             string
	CreatedAt          pgtype.Timestamptz
	ResolvedAt         pgtype.Timestamptz
	ParentCommentID    pgtype.Text
	RootCommentID      string
}

type CommentMention

type CommentMention struct {
	CommentID     string
	PrincipalType string
	PrincipalID   string
	// Zero-based offset in UTF-16 code units, matching JavaScript string indexes.
	OffsetUtf16 int32
	// Mention length in UTF-16 code units, matching JavaScript string indexes.
	LengthUtf16 int32
	// Internal snapshot of the exact visible @label, used to preserve valid mentions across principal renames.
	LabelText string
}

Structured principals mentioned in comment bodies. Mention metadata grants no access; future notification delivery must re-check effective document access and apply rate limits.

type CommentNotificationOutbox

type CommentNotificationOutbox struct {
	CommentID   string
	RecipientID string
	Reason      string
	Attempts    int32
	AvailableAt pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
}

type CommentPlacement

type CommentPlacement struct {
	ID          string
	CommentID   string
	VersionID   string
	Status      string
	AnchorJson  []byte
	MatchedText pgtype.Text
	Confidence  float64
	CreatedAt   pgtype.Timestamptz
}

type CommentReaction

type CommentReaction struct {
	CommentID     string
	PrincipalType string
	PrincipalID   string
	// Stable ASCII slug from a fixed set, not a literal emoji character, so the value is URL-safe and each client chooses its own glyph. The CHECK keeps an old pod or a direct SQL writer from storing a slug clients cannot render.
	Emoji     string
	CreatedAt pgtype.Timestamptz
}

Lightweight acknowledgements on comments and replies. One row per (comment, principal, emoji); the primary key makes adding a reaction idempotent and removing one a primary-key delete.

type CreateCLICredentialParams

type CreateCLICredentialParams struct {
	ID        string
	UserID    string
	Name      string
	TokenHash string
}

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 DeclineOwnershipTransferParams

type DeclineOwnershipTransferParams struct {
	ID         string
	FromUserID string
}

type DeleteCommentReactionParams

type DeleteCommentReactionParams struct {
	CommentID     string
	PrincipalType string
	PrincipalID   string
	Emoji         string
}

type DeleteDocumentKVParams

type DeleteDocumentKVParams struct {
	DocumentID     string
	Key            string
	Revision       int64
	UpdatedByType  string
	UpdatedByID    string
	UpdatedByEmail string
	UpdatedByName  string
}

type DeleteFolderSubtreeParams

type DeleteFolderSubtreeParams struct {
	FolderID  string
	OwnerType string
	OwnerID   string
}

type DeletePinParams

type DeletePinParams struct {
	PrincipalType string
	PrincipalID   string
	ResourceType  string
	ResourceID    string
}

type DeleteStaleDocumentPresenceEventsParams

type DeleteStaleDocumentPresenceEventsParams struct {
	DocumentID    string
	MaxAgeSeconds int32
}

type Document

type Document struct {
	ID               string
	Title            string
	OwnerID          string
	CurrentVersionID pgtype.Text
	CreatedAt        pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
	OwnerType        string
	ParentFolderID   pgtype.Text
}

type DocumentAccessNotificationOutbox

type DocumentAccessNotificationOutbox struct {
	DocumentID   string
	RecipientID  string
	Source       string
	Reason       string
	PreviousRole string
	Role         string
	Attempts     int32
	AvailableAt  pgtype.Timestamptz
	CreatedAt    pgtype.Timestamptz
}

type DocumentAccessRequest

type DocumentAccessRequest struct {
	DocumentID    string
	RequesterType string
	RequesterID   string
	RequestedAt   pgtype.Timestamptz
}

type DocumentAccessRequestNotificationOutbox

type DocumentAccessRequestNotificationOutbox struct {
	DocumentID     string
	RequesterType  string
	RequesterID    string
	RequesterLabel string
	RecipientID    string
	Attempts       int32
	AvailableAt    pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
}

type DocumentKv

type DocumentKv struct {
	DocumentID     string
	Key            string
	Value          []byte
	Revision       int64
	UpdatedAt      pgtype.Timestamptz
	UpdatedByType  string
	UpdatedByID    string
	UpdatedByEmail string
	UpdatedByName  string
	DeletedAt      pgtype.Timestamptz
}

type DocumentKvEvent

type DocumentKvEvent struct {
	DocumentID     string
	Revision       int64
	Changes        []byte
	UpdatedAt      pgtype.Timestamptz
	UpdatedByType  string
	UpdatedByID    string
	UpdatedByEmail string
	UpdatedByName  string
	Kind           string
	Data           []byte
}

type DocumentLabel

type DocumentLabel struct {
	DocumentID    string
	Label         string
	CreatedByType string
	CreatedByID   string
	CreatedAt     pgtype.Timestamptz
}

type DocumentNotificationMute

type DocumentNotificationMute struct {
	PrincipalType string
	PrincipalID   string
	DocumentID    string
}

type DocumentWorkspaceEntry

type DocumentWorkspaceEntry struct {
	DocumentID    string
	PrincipalType string
	PrincipalID   string
	AddedAt       pgtype.Timestamptz
}

type FindChildFolderIDByTitleParams

type FindChildFolderIDByTitleParams struct {
	ParentFolderID string
	Title          string
}

type FindRootFoldersByTitleParams

type FindRootFoldersByTitleParams struct {
	Title          string
	PrincipalType  string
	PrincipalID    string
	GoogleGroupIds []string
}

type FindRootFoldersByTitleRow

type FindRootFoldersByTitleRow struct {
	ID         string
	Title      string
	OwnerType  string
	OwnerID    string
	OwnerName  string
	OwnerEmail string
}

type Folder

type Folder struct {
	ID             string
	Title          string
	OwnerType      string
	OwnerID        string
	ParentFolderID pgtype.Text
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type FolderWorkspaceEntry

type FolderWorkspaceEntry struct {
	FolderID      string
	PrincipalType string
	PrincipalID   string
	AddedAt       pgtype.Timestamptz
	LastOpenedAt  pgtype.Timestamptz
}

type GetCommentForReplyRow

type GetCommentForReplyRow struct {
	ID                 string
	DocumentID         string
	CreatedOnVersionID string
	AuthorType         string
	AuthorID           string
	AuthorEmail        string
	AuthorName         string
	Body               string
	SelectedText       string
	AnchorJson         []byte
	Status             string
	ParentCommentID    pgtype.Text
	RootCommentID      string
	CreatedAt          pgtype.Timestamptz
	ResolvedAt         pgtype.Timestamptz
}

type GetCommentForUpdateRow

type GetCommentForUpdateRow struct {
	ID                 string
	DocumentID         string
	CreatedOnVersionID string
	AuthorType         string
	AuthorID           string
	AuthorEmail        string
	AuthorName         string
	Body               string
	SelectedText       string
	AnchorJson         []byte
	Status             string
	ParentCommentID    pgtype.Text
	RootCommentID      string
	CreatedAt          pgtype.Timestamptz
	ResolvedAt         pgtype.Timestamptz
}

type GetCommentRow

type GetCommentRow struct {
	ID                 string
	DocumentID         string
	CreatedOnVersionID string
	AuthorType         string
	AuthorID           string
	AuthorEmail        string
	AuthorName         string
	Body               string
	SelectedText       string
	AnchorJson         []byte
	Status             string
	ParentCommentID    pgtype.Text
	RootCommentID      string
	CreatedAt          pgtype.Timestamptz
	ResolvedAt         pgtype.Timestamptz
}

type GetDocumentOwnerRow

type GetDocumentOwnerRow struct {
	OwnerType string
	OwnerID   string
}

type GetDocumentRow

type GetDocumentRow struct {
	ID               string
	Title            string
	CurrentVersionID pgtype.Text
	OwnerType        string
	OwnerID          string
	OwnerEmail       string
	OwnerName        string
	ParentFolderID   string
}

type GetDocumentVersionForUpdateRow

type GetDocumentVersionForUpdateRow struct {
	CurrentVersionID pgtype.Text
	NextNumber       int32
}

type GetFolderOwnershipParams

type GetFolderOwnershipParams struct {
	FolderID  string
	OwnerType string
	OwnerID   string
}

type GetFolderOwnershipRow

type GetFolderOwnershipRow struct {
	FolderExists bool
	IsOwner      bool
}

type GetFolderRow

type GetFolderRow struct {
	ID             string
	Title          string
	OwnerType      string
	OwnerID        string
	ParentFolderID string
	OwnerName      string
	OwnerEmail     string
}

type GetGitHubConnectionRow

type GetGitHubConnectionRow struct {
	UserID                string
	GithubUserID          int64
	Login                 string
	AvatarUrl             string
	AccessTokenCiphertext []byte
	UpdatedAt             pgtype.Timestamptz
}

type GetMentionServiceAccountRow

type GetMentionServiceAccountRow struct {
	ID   string
	Name string
}

type GetMentionUserRow

type GetMentionUserRow struct {
	ID         string
	Email      string
	Name       string
	PictureUrl string
}

type GetOwnershipTransferForUpdateRow

type GetOwnershipTransferForUpdateRow struct {
	ID               string
	ServiceAccountID string
	FromUserID       string
	ToUserID         string
	Status           string
}

type GetServiceAccountByNameRow

type GetServiceAccountByNameRow struct {
	ID         string
	Name       string
	Disabled   bool
	OwnerID    string
	OwnerEmail string
	OwnerName  string
}

type GetServiceAccountRow

type GetServiceAccountRow struct {
	ID         string
	Name       string
	Disabled   bool
	OwnerID    string
	OwnerEmail string
	OwnerName  string
}

type GetSignedInUserByEmailRow

type GetSignedInUserByEmailRow struct {
	ID         string
	Email      string
	Name       string
	PictureUrl string
}

type GetUserByEmailRow

type GetUserByEmailRow struct {
	ID         string
	Email      string
	Name       string
	PictureUrl string
}

type GetUserByGoogleSubRow

type GetUserByGoogleSubRow struct {
	ID         string
	Email      string
	Name       string
	PictureUrl string
}

type GetUserByIDRow

type GetUserByIDRow struct {
	ID         string
	Email      string
	Name       string
	PictureUrl string
}

type GetVersionRow

type GetVersionRow struct {
	ID                  string
	Number              int32
	DocumentID          string
	CreatedByType       string
	CreatedByID         string
	CreatedByEmail      string
	CreatedByName       string
	CreatedByPictureUrl string
	ChangeSummary       string
	Sha256              string
	CreatedAt           pgtype.Timestamptz
}

type GithubConnection

type GithubConnection struct {
	UserID                string
	GithubUserID          int64
	Login                 string
	AvatarUrl             string
	AccessTokenCiphertext []byte
	CreatedAt             pgtype.Timestamptz
	UpdatedAt             pgtype.Timestamptz
}

type GithubRepoAccess

type GithubRepoAccess struct {
	UserID    string
	Owner     string
	Repo      string
	CanRead   bool
	CheckedAt pgtype.Timestamptz
}

type GoogleGroup

type GoogleGroup struct {
	ID             string
	CustomerID     string
	Email          string
	DisplayName    string
	LastVerifiedAt pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type GoogleGroupMembership

type GoogleGroupMembership struct {
	UserID   string
	GroupID  string
	SyncedAt pgtype.Timestamptz
}

type GoogleGroupSyncState

type GoogleGroupSyncState struct {
	UserID        string
	LastAttemptAt pgtype.Timestamptz
	LastSuccessAt pgtype.Timestamptz
	LastErrorCode string
}

type HiddenFeaturedItem

type HiddenFeaturedItem struct {
	PrincipalType string
	PrincipalID   string
	ResourceID    string
	HiddenAt      pgtype.Timestamptz
}

type HideFeaturedItemParams

type HideFeaturedItemParams struct {
	PrincipalType string
	PrincipalID   string
	ResourceID    string
}

type InsertCommentMentionParams

type InsertCommentMentionParams struct {
	CommentID     string
	PrincipalType string
	PrincipalID   string
	OffsetUtf16   int64
	LengthUtf16   int64
	LabelText     string
}

type InsertCommentParams

type InsertCommentParams struct {
	ID                 string
	DocumentID         string
	CreatedOnVersionID string
	AuthorType         string
	AuthorID           string
	AuthorEmail        string
	AuthorName         string
	Body               string
	SelectedText       string
	AnchorJson         []byte
}

type InsertCommentReplyParams

type InsertCommentReplyParams struct {
	ID                 string
	DocumentID         string
	CreatedOnVersionID string
	AuthorType         string
	AuthorID           string
	AuthorEmail        string
	AuthorName         string
	Body               string
	ParentCommentID    pgtype.Text
	RootCommentID      string
}

type InsertDocumentKVEventParams

type InsertDocumentKVEventParams struct {
	DocumentID     string
	Revision       int64
	Kind           string
	Changes        []byte
	Data           []byte
	UpdatedByType  string
	UpdatedByID    string
	UpdatedByEmail string
	UpdatedByName  string
}

type InsertDocumentLabelParams

type InsertDocumentLabelParams struct {
	DocumentID    string
	Label         string
	CreatedByType string
	CreatedByID   string
}

type InsertDocumentParams

type InsertDocumentParams struct {
	ID        string
	Title     string
	OwnerType string
	OwnerID   string
}

type InsertFolderParams

type InsertFolderParams struct {
	ID             string
	Title          string
	OwnerType      string
	OwnerID        string
	ParentFolderID string
}

type InsertInitialVersionParams

type InsertInitialVersionParams struct {
	ID            string
	DocumentID    string
	HtmlBlobKey   string
	Sha256        string
	CreatedByType string
	CreatedByID   string
	SearchText    string
}

type InsertOwnershipTransferParams

type InsertOwnershipTransferParams struct {
	ID               string
	ServiceAccountID string
	FromUserID       string
	ToUserID         string
}

type InsertPlaceholderUserParams

type InsertPlaceholderUserParams struct {
	ID    string
	Email string
}

type InsertServiceAccountKeyParams

type InsertServiceAccountKeyParams struct {
	ID               string
	ServiceAccountID string
	Name             string
	TokenHash        string
}

type InsertServiceAccountParams

type InsertServiceAccountParams struct {
	ID          string
	Name        string
	OwnerUserID string
}

type InsertVersionParams

type InsertVersionParams struct {
	ID              string
	DocumentID      string
	Number          int32
	HtmlBlobKey     string
	Sha256          string
	ParentVersionID pgtype.Text
	CreatedByType   string
	CreatedByID     string
	ChangeSummary   string
	SearchText      string
}

type IsFolderAncestorOfParams

type IsFolderAncestorOfParams struct {
	FolderID string
	StartID  string
}

type ListAccessibleDocumentsByLabelParams

type ListAccessibleDocumentsByLabelParams struct {
	Label          string
	OwnerType      string
	OwnerID        string
	GoogleGroupIds []string
}

type ListAccessibleDocumentsByLabelRow

type ListAccessibleDocumentsByLabelRow struct {
	ID               string
	Title            string
	CurrentVersionID pgtype.Text
	OwnerType        string
	OwnerID          string
	OwnerEmail       string
	OwnerName        string
	UpdatedAt        pgtype.Timestamptz
}

type ListCLICredentialsRow

type ListCLICredentialsRow struct {
	ID   string
	Name string
}

type ListChildFoldersRow

type ListChildFoldersRow struct {
	ID             string
	Title          string
	OwnerType      string
	OwnerID        string
	ParentFolderID string
	OwnerName      string
	OwnerEmail     string
}

type ListCommentMentionsRow

type ListCommentMentionsRow struct {
	CommentID           string
	PrincipalType       string
	PrincipalID         string
	PrincipalEmail      string
	PrincipalName       string
	PrincipalPictureUrl string
	OffsetUtf16         int32
	LengthUtf16         int32
	LabelText           string
}

type ListCommentReactionsRow

type ListCommentReactionsRow struct {
	CommentID      string
	PrincipalType  string
	PrincipalID    string
	Emoji          string
	PrincipalEmail string
	PrincipalName  string
}

type ListCommentsParams

type ListCommentsParams struct {
	DocumentID string
	Status     string
	VersionID  string
}

type ListCommentsRow

type ListCommentsRow struct {
	ID                 string
	DocumentID         string
	CreatedOnVersionID string
	AuthorType         string
	AuthorID           string
	AuthorEmail        string
	AuthorName         string
	Body               string
	SelectedText       string
	AnchorJson         []byte
	Status             string
	ParentCommentID    pgtype.Text
	RootCommentID      string
	CreatedAt          pgtype.Timestamptz
	ResolvedAt         pgtype.Timestamptz
}

type ListDocumentInheritedGrantsRow

type ListDocumentInheritedGrantsRow struct {
	ResourceID    string
	PrincipalType string
	PrincipalID   string
	Role          string
}

type ListDocumentKVEventsAfterParams

type ListDocumentKVEventsAfterParams struct {
	DocumentID string
	Revision   int64
	Limit      int32
}

type ListDocumentKVRow

type ListDocumentKVRow struct {
	Key            string
	Value          []byte
	Revision       int64
	UpdatedAt      pgtype.Timestamptz
	UpdatedByType  string
	UpdatedByID    string
	UpdatedByEmail string
	UpdatedByName  string
}

type ListDocumentsParams

type ListDocumentsParams struct {
	OwnerID   string
	OwnerType string
	Column3   []string
}

type ListDocumentsRow

type ListDocumentsRow struct {
	ID               string
	Title            string
	CurrentVersionID pgtype.Text
	OwnerType        string
	OwnerID          string
	OwnerEmail       string
	OwnerName        string
	UpdatedAt        pgtype.Timestamptz
}

type ListFolderAccessChainParams

type ListFolderAccessChainParams struct {
	PrincipalType  string
	PrincipalID    string
	GoogleGroupIds []string
	FolderID       string
}

type ListFolderAccessChainRow

type ListFolderAccessChainRow struct {
	ID        string
	Title     string
	IsOwner   bool
	GrantRank int32
}

type ListFolderAncestorsParams

type ListFolderAncestorsParams struct {
	FolderID string
	MaxDepth int32
}

type ListFolderAncestorsRow

type ListFolderAncestorsRow struct {
	ID    string
	Title string
}

type ListFolderDocumentsRow

type ListFolderDocumentsRow struct {
	ID               string
	Title            string
	OwnerType        string
	OwnerID          string
	CurrentVersionID string
	ParentFolderID   string
	OwnerName        string
	OwnerEmail       string
}

type ListFolderSubtreeOrphansParams

type ListFolderSubtreeOrphansParams struct {
	OwnerType string
	OwnerID   string
	FolderID  string
}

type ListFolderSubtreeOrphansRow

type ListFolderSubtreeOrphansRow struct {
	ID        string
	Title     string
	OwnerType string
	OwnerID   string
}

type ListGitHubAuthorAccessParams

type ListGitHubAuthorAccessParams struct {
	Owner      string
	Repo       string
	FreshAfter pgtype.Timestamptz
	DocumentID string
}

type ListGitHubAuthorAccessRow

type ListGitHubAuthorAccessRow struct {
	CreatedByType         string
	CreatedByID           string
	UserID                pgtype.Text
	AccessTokenCiphertext []byte
	CanRead               pgtype.Bool
}

type ListGrantsForResourcesRow

type ListGrantsForResourcesRow struct {
	ID             string
	ResourceID     string
	ResourceType   string
	PrincipalType  string
	PrincipalID    string
	PrincipalEmail string
	PrincipalName  string
	Role           string
}

type ListHiddenFeaturedItemsParams

type ListHiddenFeaturedItemsParams struct {
	PrincipalType string
	PrincipalID   string
}

type ListOwnershipTransfersRow

type ListOwnershipTransfersRow struct {
	ID               string
	ServiceAccountID string
	FromUserID       string
	ToUserID         string
	Status           string
}

type ListPinsParams

type ListPinsParams struct {
	PrincipalType string
	PrincipalID   string
}

type ListPinsRow

type ListPinsRow struct {
	ResourceType string
	ResourceID   string
}

type ListRecentDocumentPresenceEventsParams

type ListRecentDocumentPresenceEventsParams struct {
	DocumentID    string
	MaxAgeSeconds int32
}

type ListResourceAncestorsParams

type ListResourceAncestorsParams struct {
	ResourceID   string
	ResourceType string
}

type ListResourceAncestorsRow

type ListResourceAncestorsRow struct {
	AncestorID      string
	AncestorType    string
	Title           string
	OwnerType       string
	OwnerID         string
	OwnerEmail      string
	OwnerName       string
	OwnerPictureUrl string
}

type ListResourceGrantsRow

type ListResourceGrantsRow struct {
	ID                  string
	ResourceType        string
	ResourceID          string
	PrincipalType       string
	PrincipalID         string
	PrincipalEmail      string
	PrincipalName       string
	PrincipalPictureUrl string
	Role                string
	GrantedByType       string
	GrantedByUserID     string
	GrantedByEmail      string
	GrantedByName       string
}

type ListRootFolderEntriesParams

type ListRootFolderEntriesParams struct {
	PrincipalType  string
	PrincipalID    string
	GoogleGroupIds []string
}

type ListRootFolderEntriesRow

type ListRootFolderEntriesRow struct {
	ID             string
	Title          string
	OwnerType      string
	OwnerID        string
	ParentFolderID string
	OwnerName      string
	OwnerEmail     string
	LastActive     pgtype.Timestamptz
}

type ListServiceAccountKeysRow

type ListServiceAccountKeysRow struct {
	ID   string
	Name string
}

type ListServiceAccountsRow

type ListServiceAccountsRow struct {
	ID         string
	Name       string
	Disabled   bool
	OwnerID    string
	OwnerEmail string
	OwnerName  string
}

type ListUnindexedVersionsParams

type ListUnindexedVersionsParams struct {
	Skipped  []string
	RowLimit int32
}

type ListUnindexedVersionsRow

type ListUnindexedVersionsRow struct {
	ID          string
	HtmlBlobKey string
}

type ListVersionsRow

type ListVersionsRow struct {
	ID                  string
	Number              int32
	DocumentID          string
	CreatedByType       string
	CreatedByID         string
	CreatedByEmail      string
	CreatedByName       string
	CreatedByPictureUrl string
	ChangeSummary       string
	Sha256              string
	CreatedAt           pgtype.Timestamptz
}

type MoveDocumentToFolderParams

type MoveDocumentToFolderParams struct {
	FolderID   string
	DocumentID string
}

type MoveDocumentToRootParams

type MoveDocumentToRootParams struct {
	DocumentID string
	FolderID   string
}

type NotificationPreference

type NotificationPreference struct {
	PrincipalType string
	PrincipalID   string
	Enabled       bool
}

type OauthState

type OauthState struct {
	ID        string
	Kind      string
	StateJson []byte
	ExpiresAt pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type OwnershipTransfer

type OwnershipTransfer struct {
	ID               string
	ServiceAccountID string
	FromUserID       string
	ToUserID         string
	InitiatedAt      pgtype.Timestamptz
	AcceptedAt       pgtype.Timestamptz
	Status           string
}

type Pin

type Pin struct {
	PrincipalType string
	PrincipalID   string
	ResourceType  string
	ResourceID    string
	PinnedAt      pgtype.Timestamptz
}

type PutCommentReactionParams

type PutCommentReactionParams struct {
	CommentID     string
	PrincipalType string
	PrincipalID   string
	Emoji         string
}

type PutPinParams

type PutPinParams struct {
	PrincipalType string
	PrincipalID   string
	ResourceType  string
	ResourceID    string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AcceptOwnershipTransfer

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) AcquireFolderTreeLock

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

Serializes folder-structure mutations (create under a parent, re-parent, delete, move documents) for the rest of the transaction. Cycle and depth invariants are check-then-write and cannot be expressed as constraints, so concurrent tree mutations must not interleave. Folder trees are small and mutations rare; one global transaction-scoped advisory lock keeps this simple and obviously correct.

func (*Queries) CreateCLICredential

func (q *Queries) CreateCLICredential(ctx context.Context, arg CreateCLICredentialParams) error

func (*Queries) DeclineOwnershipTransfer

func (q *Queries) DeclineOwnershipTransfer(ctx context.Context, arg DeclineOwnershipTransferParams) (string, error)

func (*Queries) DeleteComment

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

func (*Queries) DeleteCommentMentions

func (q *Queries) DeleteCommentMentions(ctx context.Context, commentID string) error

func (*Queries) DeleteCommentReaction

func (q *Queries) DeleteCommentReaction(ctx context.Context, arg DeleteCommentReactionParams) error

func (*Queries) DeleteDocument

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

func (*Queries) DeleteDocumentKV

func (q *Queries) DeleteDocumentKV(ctx context.Context, arg DeleteDocumentKVParams) error

func (*Queries) DeleteDocumentLabels

func (q *Queries) DeleteDocumentLabels(ctx context.Context, documentID string) error

func (*Queries) DeleteFolderSubtree

func (q *Queries) DeleteFolderSubtree(ctx context.Context, arg DeleteFolderSubtreeParams) (int64, error)

Deletes the folder and every folder below it that the same principal owns. The walk stops at folders that other principals own.

func (*Queries) DeleteGitHubConnection

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

func (*Queries) DeletePin

func (q *Queries) DeletePin(ctx context.Context, arg DeletePinParams) error

func (*Queries) DeleteStaleDocumentPresenceEvents

func (q *Queries) DeleteStaleDocumentPresenceEvents(ctx context.Context, arg DeleteStaleDocumentPresenceEventsParams) error

func (*Queries) DisableServiceAccount

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) EnableServiceAccount

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) FindChildFolderIDByTitle

func (q *Queries) FindChildFolderIDByTitle(ctx context.Context, arg FindChildFolderIDByTitleParams) (string, error)

func (*Queries) FindRootFoldersByTitle

func (q *Queries) FindRootFoldersByTitle(ctx context.Context, arg FindRootFoldersByTitleParams) ([]FindRootFoldersByTitleRow, error)

Resolves the first segment of a folder path: root folders with the given title that the principal owns or can reach through a grant. Owned folders sort first so an owned folder wins over a same-named shared one. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) FolderOrAncestorsHaveGrants

func (q *Queries) FolderOrAncestorsHaveGrants(ctx context.Context, folderID string) (bool, error)

Whether the folder or any of its ancestors carries an active grant, i.e. placing content inside it may broaden who can see that content.

func (*Queries) GetComment

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

func (*Queries) GetCommentForReply

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

func (*Queries) GetCommentForUpdate

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

func (*Queries) GetDocument

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) GetDocumentKVRevision

func (q *Queries) GetDocumentKVRevision(ctx context.Context, documentID string) (int64, error)

Live events share the KV revision sequence, so the high-water mark spans both the KV rows and the event log.

func (*Queries) GetDocumentOwner

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

func (*Queries) GetDocumentVersionForUpdate

func (q *Queries) GetDocumentVersionForUpdate(ctx context.Context, documentID string) (GetDocumentVersionForUpdateRow, error)

func (*Queries) GetFolder

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) GetFolderDepth

func (q *Queries) GetFolderDepth(ctx context.Context, folderID string) (int32, error)

Number of folders on the path from @folder_id up to its root (0 when the folder does not exist).

func (*Queries) GetFolderOwnership

func (q *Queries) GetFolderOwnership(ctx context.Context, arg GetFolderOwnershipParams) (GetFolderOwnershipRow, error)

func (*Queries) GetFolderSubtreeHeight

func (q *Queries) GetFolderSubtreeHeight(ctx context.Context, folderID string) (int32, error)

Height of the subtree rooted at @folder_id, counting the folder itself.

func (*Queries) GetGitHubConnection

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

func (*Queries) GetMentionServiceAccount

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) GetMentionUser

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

func (*Queries) GetOwnershipTransferForUpdate

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) GetServiceAccount

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) GetServiceAccountByName

func (q *Queries) GetServiceAccountByName(ctx context.Context, name string) (GetServiceAccountByNameRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) GetSignedInUserByEmail

func (q *Queries) GetSignedInUserByEmail(ctx context.Context, email string) (GetSignedInUserByEmailRow, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)

func (*Queries) GetUserByGoogleSub

func (q *Queries) GetUserByGoogleSub(ctx context.Context, googleSub pgtype.Text) (GetUserByGoogleSubRow, error)

func (*Queries) GetUserByID

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

func (*Queries) GetUserIDByEmail

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

func (*Queries) GetVersion

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) GetVersionBlobKey

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

func (*Queries) HideFeaturedItem

func (q *Queries) HideFeaturedItem(ctx context.Context, arg HideFeaturedItemParams) error

func (*Queries) InsertComment

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

func (*Queries) InsertCommentMention

func (q *Queries) InsertCommentMention(ctx context.Context, arg InsertCommentMentionParams) error

func (*Queries) InsertCommentReply

func (q *Queries) InsertCommentReply(ctx context.Context, arg InsertCommentReplyParams) (pgtype.Timestamptz, error)

func (*Queries) InsertDocument

func (q *Queries) InsertDocument(ctx context.Context, arg InsertDocumentParams) error

func (*Queries) InsertDocumentKVEvent

func (q *Queries) InsertDocumentKVEvent(ctx context.Context, arg InsertDocumentKVEventParams) error

func (*Queries) InsertDocumentLabel

func (q *Queries) InsertDocumentLabel(ctx context.Context, arg InsertDocumentLabelParams) error

func (*Queries) InsertFolder

func (q *Queries) InsertFolder(ctx context.Context, arg InsertFolderParams) error

func (*Queries) InsertInitialVersion

func (q *Queries) InsertInitialVersion(ctx context.Context, arg InsertInitialVersionParams) (pgtype.Timestamptz, error)

func (*Queries) InsertOwnershipTransfer

func (q *Queries) InsertOwnershipTransfer(ctx context.Context, arg InsertOwnershipTransferParams) error

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) InsertPlaceholderUser

func (q *Queries) InsertPlaceholderUser(ctx context.Context, arg InsertPlaceholderUserParams) error

func (*Queries) InsertServiceAccount

func (q *Queries) InsertServiceAccount(ctx context.Context, arg InsertServiceAccountParams) error

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) InsertServiceAccountKey

func (q *Queries) InsertServiceAccountKey(ctx context.Context, arg InsertServiceAccountKeyParams) error

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) InsertVersion

func (q *Queries) InsertVersion(ctx context.Context, arg InsertVersionParams) (pgtype.Timestamptz, error)

func (*Queries) IsFolderAncestorOf

func (q *Queries) IsFolderAncestorOf(ctx context.Context, arg IsFolderAncestorOfParams) (bool, error)

Reports whether @folder_id appears on the ancestor chain that starts at @start_id (inclusive). Used to reject re-parenting that would create a cycle.

func (*Queries) ListCLICredentials

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

func (*Queries) ListChildFolders

func (q *Queries) ListChildFolders(ctx context.Context, parentFolderID string) ([]ListChildFoldersRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListCommentMentions

func (q *Queries) ListCommentMentions(ctx context.Context, commentIds []string) ([]ListCommentMentionsRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListCommentReactions

func (q *Queries) ListCommentReactions(ctx context.Context, commentIds []string) ([]ListCommentReactionsRow, error)

Ordering by created_at before emoji lets the JSON layer aggregate in first-reaction order, so the emoji a thread used first stays leftmost.

func (*Queries) ListComments

func (q *Queries) ListComments(ctx context.Context, arg ListCommentsParams) ([]ListCommentsRow, error)

func (*Queries) ListDocumentInheritedGrants

func (q *Queries) ListDocumentInheritedGrants(ctx context.Context, documentID string) ([]ListDocumentInheritedGrantsRow, error)

All active grants on a document and on every folder above it. The caller folds these (plus ownership) into the principal's effective role.

func (*Queries) ListDocumentKV

func (q *Queries) ListDocumentKV(ctx context.Context, documentID string) ([]ListDocumentKVRow, error)

func (*Queries) ListDocumentKVEventsAfter

func (q *Queries) ListDocumentKVEventsAfter(ctx context.Context, arg ListDocumentKVEventsAfterParams) ([]DocumentKvEvent, error)

func (*Queries) ListDocumentLabels

func (q *Queries) ListDocumentLabels(ctx context.Context, documentID string) ([]string, error)

func (*Queries) ListDocuments

func (q *Queries) ListDocuments(ctx context.Context, arg ListDocumentsParams) ([]ListDocumentsRow, error)

A document appears in a principal's workspace when they:

  1. own it, or
  2. hold an explicit (user/service-account) grant for it, or
  3. have opened it (a workspace entry exists) AND it is still broadly shared via an active "anyone" grant.

A bare "anyone" grant alone does NOT list the document: broad access grants access via discovery/link, it does not place the document in every user's workspace until they open it. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListFolderAccessChain

func (q *Queries) ListFolderAccessChain(ctx context.Context, arg ListFolderAccessChainParams) ([]ListFolderAccessChainRow, error)

A folder's ancestor chain (root first, the folder itself last) annotated with the principal's access at each level, resolved in one round trip. A grant on a folder applies to it and everything below it, so the strongest grant for chain element X is taken over X and all of X's ancestors (chain elements with depth >= X's). Rank order mirrors repo.MaxRole: owner=4, editor=3, commenter=2, viewer=1.

func (*Queries) ListFolderAncestors

func (q *Queries) ListFolderAncestors(ctx context.Context, arg ListFolderAncestorsParams) ([]ListFolderAncestorsRow, error)

Breadcrumbs for a folder: its ancestors starting from @folder_id upwards, returned root-first.

func (*Queries) ListFolderDocuments

func (q *Queries) ListFolderDocuments(ctx context.Context, folderID string) ([]ListFolderDocumentsRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListFolderSubtreeOrphans

func (q *Queries) ListFolderSubtreeOrphans(ctx context.Context, arg ListFolderSubtreeOrphansParams) ([]ListFolderSubtreeOrphansRow, error)

The folders that other principals own directly inside the folders that DeleteFolderSubtree removes. Like Google Drive, a folder delete keeps them.

func (*Queries) ListGitHubAuthorAccess

func (q *Queries) ListGitHubAuthorAccess(ctx context.Context, arg ListGitHubAuthorAccessParams) ([]ListGitHubAuthorAccessRow, error)

One row for each principal who created a version of the document. user_id is the user whose GitHub access counts for the author: the author, or the owner of a service account, because the owner controls its keys. The row also has that user's sealed GitHub token (NULL when not connected) and the cached access answer (NULL when missing, older than fresh_after, or older than the user's last GitHub connection).

func (*Queries) ListGrantsForResources

func (q *Queries) ListGrantsForResources(ctx context.Context, resourceIds []string) ([]ListGrantsForResourcesRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListHiddenFeaturedItems

func (q *Queries) ListHiddenFeaturedItems(ctx context.Context, arg ListHiddenFeaturedItemsParams) ([]string, error)

func (*Queries) ListOwnershipTransfers

func (q *Queries) ListOwnershipTransfers(ctx context.Context, fromUserID string) ([]ListOwnershipTransfersRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListPins

func (q *Queries) ListPins(ctx context.Context, arg ListPinsParams) ([]ListPinsRow, error)

func (*Queries) ListRecentDocumentPresenceEvents

func (q *Queries) ListRecentDocumentPresenceEvents(ctx context.Context, arg ListRecentDocumentPresenceEventsParams) ([]DocumentKvEvent, error)

func (*Queries) ListResourceAncestors

func (q *Queries) ListResourceAncestors(ctx context.Context, arg ListResourceAncestorsParams) ([]ListResourceAncestorsRow, error)

The resource itself plus every folder above it, with titles and owners, for the effective-access report. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListResourceGrants

func (q *Queries) ListResourceGrants(ctx context.Context, resourceID string) ([]ListResourceGrantsRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListRootFolderEntries

func (q *Queries) ListRootFolderEntries(ctx context.Context, arg ListRootFolderEntriesParams) ([]ListRootFolderEntriesRow, error)

A principal's folder workspace: root folders they own or hold an explicit grant on, root folders they opened that are still shared with "anyone", and shared subfolders they opened whose ancestors they have no workspace entry for (so a folder deep in someone else's tree surfaces at the top level). nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListServiceAccountKeys

func (q *Queries) ListServiceAccountKeys(ctx context.Context, serviceAccountID string) ([]ListServiceAccountKeysRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListServiceAccounts

func (q *Queries) ListServiceAccounts(ctx context.Context, ownerUserID string) ([]ListServiceAccountsRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) ListUnindexedVersions

func (q *Queries) ListUnindexedVersions(ctx context.Context, arg ListUnindexedVersionsParams) ([]ListUnindexedVersionsRow, error)

Locks the rows, so that servers that index at the same time skip each other's versions. Only current versions are searched.

func (*Queries) ListVersions

func (q *Queries) ListVersions(ctx context.Context, documentID string) ([]ListVersionsRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) LockDocumentForKV

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

Serializes revision allocation. NO KEY UPDATE still excludes every other allocator but, unlike FOR UPDATE, does not wait on foreign-key checks from concurrent comment and version writes.

func (*Queries) MoveDocumentToFolder

func (q *Queries) MoveDocumentToFolder(ctx context.Context, arg MoveDocumentToFolderParams) (int64, error)

func (*Queries) MoveDocumentToRoot

func (q *Queries) MoveDocumentToRoot(ctx context.Context, arg MoveDocumentToRootParams) error

func (*Queries) NotifyDocumentKVEvent

func (q *Queries) NotifyDocumentKVEvent(ctx context.Context, documentID string) error

func (*Queries) PutCommentReaction

func (q *Queries) PutCommentReaction(ctx context.Context, arg PutCommentReactionParams) error

func (*Queries) PutPin

func (q *Queries) PutPin(ctx context.Context, arg PutPinParams) error

func (*Queries) RecordFolderWorkspaceEntry

func (q *Queries) RecordFolderWorkspaceEntry(ctx context.Context, arg RecordFolderWorkspaceEntryParams) error

func (*Queries) RecordWorkspaceEntry

func (q *Queries) RecordWorkspaceEntry(ctx context.Context, arg RecordWorkspaceEntryParams) error

Records that a principal has opened a document, so a broadly-shared ("anyone") document joins their workspace listing after first open. Idempotent.

func (*Queries) ResolveCLIToken

func (q *Queries) ResolveCLIToken(ctx context.Context, tokenHash string) (ResolveCLITokenRow, error)

func (*Queries) ResolveServiceAccountToken

func (q *Queries) ResolveServiceAccountToken(ctx context.Context, tokenHash string) (ResolveServiceAccountTokenRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) RevokeCLICredential

func (q *Queries) RevokeCLICredential(ctx context.Context, arg RevokeCLICredentialParams) error

func (*Queries) RevokeResourceGrant

func (q *Queries) RevokeResourceGrant(ctx context.Context, arg RevokeResourceGrantParams) (int64, error)

func (*Queries) RevokeServiceAccountKey

func (q *Queries) RevokeServiceAccountKey(ctx context.Context, arg RevokeServiceAccountKeyParams) error

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) RootFolderTitleTaken

func (q *Queries) RootFolderTitleTaken(ctx context.Context, arg RootFolderTitleTakenParams) (bool, error)

func (*Queries) SearchContacts added in v0.2.1

func (q *Queries) SearchContacts(ctx context.Context, arg SearchContactsParams) ([]SearchContactsRow, error)

Public servers: a partial query matches only the caller's contacts, which are the people the caller shares with and the people who share with the caller. Other users match only by their exact email, as when sharing. The query starts from the contacts, so its cost does not grow with all users.

func (*Queries) SearchDocuments

func (q *Queries) SearchDocuments(ctx context.Context, arg SearchDocumentsParams) ([]SearchDocumentsRow, error)

@match_query and @exclude_query are tsquery text. A document matches when its title or current text matches. Title words rank higher. Snippets are made after LIMIT, because ts_headline reads the whole text.

func (*Queries) SearchFoldersByTitle

func (q *Queries) SearchFoldersByTitle(ctx context.Context, arg SearchFoldersByTitleParams) ([]SearchFoldersByTitleRow, error)

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) SearchUsersByEmail

func (q *Queries) SearchUsersByEmail(ctx context.Context, lower string) ([]SearchUsersByEmailRow, error)

func (*Queries) ServiceAccountExists

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) SetVersionSearchText

func (q *Queries) SetVersionSearchText(ctx context.Context, arg SetVersionSearchTextParams) error

func (*Queries) TouchCLIToken

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

func (*Queries) TouchServiceAccountToken

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

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) UpdateCommentBody

func (q *Queries) UpdateCommentBody(ctx context.Context, arg UpdateCommentBodyParams) error

func (*Queries) UpdateCommentStatus

func (q *Queries) UpdateCommentStatus(ctx context.Context, arg UpdateCommentStatusParams) error

func (*Queries) UpdateDocumentCurrentVersion

func (q *Queries) UpdateDocumentCurrentVersion(ctx context.Context, arg UpdateDocumentCurrentVersionParams) error

func (*Queries) UpdateDocumentTitle

func (q *Queries) UpdateDocumentTitle(ctx context.Context, arg UpdateDocumentTitleParams) error

func (*Queries) UpdateFolderParent

func (q *Queries) UpdateFolderParent(ctx context.Context, arg UpdateFolderParentParams) error

func (*Queries) UpdateFolderTitle

func (q *Queries) UpdateFolderTitle(ctx context.Context, arg UpdateFolderTitleParams) error

func (*Queries) UpdateFolderTitleAndParent

func (q *Queries) UpdateFolderTitleAndParent(ctx context.Context, arg UpdateFolderTitleAndParentParams) error

func (*Queries) UpdateResourceGrantRole

func (q *Queries) UpdateResourceGrantRole(ctx context.Context, arg UpdateResourceGrantRoleParams) (UpdateResourceGrantRoleRow, error)

func (*Queries) UpdateServiceAccountName

func (q *Queries) UpdateServiceAccountName(ctx context.Context, arg UpdateServiceAccountNameParams) error

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) UpdateServiceAccountOwner

func (q *Queries) UpdateServiceAccountOwner(ctx context.Context, arg UpdateServiceAccountOwnerParams) error

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential. nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) UpsertDocumentKV

func (q *Queries) UpsertDocumentKV(ctx context.Context, arg UpsertDocumentKVParams) error

func (*Queries) UpsertGitHubConnection

func (q *Queries) UpsertGitHubConnection(ctx context.Context, arg UpsertGitHubConnectionParams) error

func (*Queries) UpsertGitHubRepoAccess

func (q *Queries) UpsertGitHubRepoAccess(ctx context.Context, arg UpsertGitHubRepoAccessParams) error

Selecting from github_connections skips the write when the user disconnected GitHub during the check.

func (*Queries) UpsertGoogleUser

func (q *Queries) UpsertGoogleUser(ctx context.Context, arg UpsertGoogleUserParams) error

nosemgrep: detected-google-gcm-service-account - slashdocs-native principal type/table, not a Google credential.

func (*Queries) UpsertResourceGrant

func (q *Queries) UpsertResourceGrant(ctx context.Context, arg UpsertResourceGrantParams) (string, error)

A revoked grant for the same (resource, principal) is resurrected by the conflict clause, keeping its ORIGINAL id; return the persisted id so callers never hand out an id that was never written.

func (*Queries) UpsertUser

func (q *Queries) UpsertUser(ctx context.Context, arg UpsertUserParams) error

func (*Queries) UserExists

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

func (*Queries) WithTx

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

type RecordFolderWorkspaceEntryParams

type RecordFolderWorkspaceEntryParams struct {
	FolderID      string
	PrincipalType string
	PrincipalID   string
}

type RecordWorkspaceEntryParams

type RecordWorkspaceEntryParams struct {
	DocumentID    string
	PrincipalType string
	PrincipalID   string
}

type ResolveCLITokenRow

type ResolveCLITokenRow struct {
	PrincipalType string
	ID            string
	Email         string
	Name          string
	PictureUrl    string
}

type ResolveServiceAccountTokenRow

type ResolveServiceAccountTokenRow struct {
	PrincipalType string
	ID            string
	Email         string
	Name          string
	PictureUrl    string
}

type ResourceGrant

type ResourceGrant struct {
	ID              string
	ResourceType    string
	ResourceID      string
	PrincipalType   string
	PrincipalID     string
	Role            string
	GrantedByUserID string
	CreatedAt       pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	GrantedByType   string
}

type RevokeCLICredentialParams

type RevokeCLICredentialParams struct {
	ID     string
	UserID string
}

type RevokeResourceGrantParams

type RevokeResourceGrantParams struct {
	GrantID    string
	ResourceID string
}

type RevokeServiceAccountKeyParams

type RevokeServiceAccountKeyParams struct {
	ServiceAccountID string
	ID               string
}

type RootFolderTitleTakenParams

type RootFolderTitleTakenParams struct {
	OwnerType string
	OwnerID   string
	Title     string
}

type SearchContactsParams added in v0.2.1

type SearchContactsParams struct {
	Query      string
	CallerType string
	CallerID   string
}

type SearchContactsRow added in v0.2.1

type SearchContactsRow struct {
	ID         string
	Email      string
	Name       string
	PictureUrl string
}

type SearchDocumentsParams

type SearchDocumentsParams struct {
	OwnerType      string
	OwnerID        string
	GoogleGroupIds []string
	IncludeOrgWide bool
	MatchQuery     string
	ExcludeQuery   string
	Owners         []string
	Folders        []string
	Labels         []string
	UpdatedSince   pgtype.Timestamptz
	UpdatedBefore  pgtype.Timestamptz
	RowLimit       int32
}

type SearchDocumentsRow

type SearchDocumentsRow struct {
	ID                string
	Title             string
	CurrentVersionID  pgtype.Text
	OwnerType         string
	OwnerID           string
	OwnerEmail        string
	OwnerName         string
	ParentFolderID    string
	ParentFolderTitle string
	UpdatedAt         pgtype.Timestamptz
	Snippet           string
}

type SearchFoldersByTitleParams

type SearchFoldersByTitleParams struct {
	Query          string
	RowLimit       int32
	PrincipalType  string
	PrincipalID    string
	GoogleGroupIds []string
	IncludeOrgWide bool
}

type SearchFoldersByTitleRow

type SearchFoldersByTitleRow struct {
	ID             string
	Title          string
	OwnerType      string
	OwnerID        string
	ParentFolderID string
	OwnerName      string
	OwnerEmail     string
}

type SearchUsersByEmailRow

type SearchUsersByEmailRow struct {
	ID         string
	Email      string
	Name       string
	PictureUrl string
}

type ServiceAccount

type ServiceAccount struct {
	ID              string
	Name            string
	OwnerUserID     string
	CreatedByUserID string
	CreatedAt       pgtype.Timestamptz
	DisabledAt      pgtype.Timestamptz
}

type ServiceAccountKey

type ServiceAccountKey struct {
	ID               string
	ServiceAccountID string
	Name             string
	TokenHash        string
	LastUsedAt       pgtype.Timestamptz
	CreatedAt        pgtype.Timestamptz
	RevokedAt        pgtype.Timestamptz
}

type SetVersionSearchTextParams

type SetVersionSearchTextParams struct {
	SearchText string
	ID         string
}

type UpdateCommentBodyParams

type UpdateCommentBodyParams struct {
	Body string
	ID   string
}

type UpdateCommentStatusParams

type UpdateCommentStatusParams struct {
	Status string
	ID     string
}

type UpdateDocumentCurrentVersionParams

type UpdateDocumentCurrentVersionParams struct {
	CurrentVersionID pgtype.Text
	ID               string
}

type UpdateDocumentTitleParams

type UpdateDocumentTitleParams struct {
	Title string
	ID    string
}

type UpdateFolderParentParams

type UpdateFolderParentParams struct {
	ParentFolderID string
	ID             string
}

type UpdateFolderTitleAndParentParams

type UpdateFolderTitleAndParentParams struct {
	Title          string
	ParentFolderID string
	ID             string
}

type UpdateFolderTitleParams

type UpdateFolderTitleParams struct {
	Title string
	ID    string
}

type UpdateResourceGrantRoleParams

type UpdateResourceGrantRoleParams struct {
	Role       string
	GrantID    string
	ResourceID string
}

type UpdateResourceGrantRoleRow

type UpdateResourceGrantRoleRow struct {
	ID              string
	ResourceType    string
	ResourceID      string
	PrincipalType   string
	PrincipalID     string
	Role            string
	GrantedByType   string
	GrantedByUserID string
}

type UpdateServiceAccountNameParams

type UpdateServiceAccountNameParams struct {
	Name string
	ID   string
}

type UpdateServiceAccountOwnerParams

type UpdateServiceAccountOwnerParams struct {
	OwnerUserID string
	ID          string
}

type UpsertDocumentKVParams

type UpsertDocumentKVParams struct {
	DocumentID     string
	Key            string
	Value          []byte
	Revision       int64
	UpdatedByType  string
	UpdatedByID    string
	UpdatedByEmail string
	UpdatedByName  string
}

type UpsertGitHubConnectionParams

type UpsertGitHubConnectionParams struct {
	UserID                string
	GithubUserID          int64
	Login                 string
	AvatarUrl             string
	AccessTokenCiphertext []byte
}

type UpsertGitHubRepoAccessParams

type UpsertGitHubRepoAccessParams struct {
	Owner   string
	Repo    string
	CanRead bool
	UserID  string
}

type UpsertGoogleUserParams

type UpsertGoogleUserParams struct {
	ID         string
	Email      string
	Name       string
	GoogleSub  pgtype.Text
	PictureUrl string
}

type UpsertResourceGrantParams

type UpsertResourceGrantParams struct {
	ID              string
	ResourceType    string
	ResourceID      string
	PrincipalType   string
	PrincipalID     string
	Role            string
	GrantedByType   string
	GrantedByUserID string
}

type UpsertUserParams

type UpsertUserParams struct {
	ID    string
	Email string
	Name  string
}

type User

type User struct {
	ID                 string
	Email              string
	Name               string
	PictureUrl         string
	GoogleSub          pgtype.Text
	CreatedAt          pgtype.Timestamptz
	NextNotificationAt pgtype.Timestamptz
}

type Version

type Version struct {
	ID              string
	DocumentID      string
	Number          int32
	HtmlBlobKey     string
	Sha256          string
	ParentVersionID pgtype.Text
	CreatedByType   string
	CreatedByID     string
	ChangeSummary   string
	CreatedAt       pgtype.Timestamptz
	SearchText      pgtype.Text
	SearchVector    interface{}
}

Jump to

Keyboard shortcuts

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