db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddBackupCodeParams

type AddBackupCodeParams struct {
	MemberID string
	CodeHash string
}

type ApiToken

type ApiToken struct {
	ID         string
	MemberID   string
	Name       string
	TokenHash  string
	Scope      string
	CreatedAt  string
	LastUsedAt *string
	RevokedAt  *string
}

type AssistantUsage

type AssistantUsage struct {
	ID           string
	HouseholdID  string
	MemberID     string
	At           string
	Kind         string
	Surface      string
	Provider     string
	Model        string
	Rounds       int64
	InputTokens  int64
	OutputTokens int64
	CostMicros   *int64
	Failed       int64
}

type AuditLog

type AuditLog struct {
	ID         string
	At         string
	ActorKind  string
	ActorID    string
	ActorLabel string
	Action     string
	Entity     string
	EntityID   string
	Before     string
	After      string
	UndoneBy   string
}

type CancelOutboxKindForChargeParams

type CancelOutboxKindForChargeParams struct {
	ChargeID *string
	Kind     string
}

type CancelOutboxRefParams

type CancelOutboxRefParams struct {
	Kind string
	Ref  string
}

type Category

type Category struct {
	ID          string
	HouseholdID string
	Name        string
	Color       string
}
type ChannelLink struct {
	ID         string
	MemberID   string
	Channel    string
	ExternalID string
	CreatedAt  string
}

type Charge

type Charge struct {
	ID              string
	SubscriptionID  string
	OriginalDate    string
	DueDate         string
	AmountMinor     int64
	Currency        string
	ChargedMinor    *int64
	ChargedCurrency *string
	Status          string
	ResolvedAt      *string
	Note            string
	UpdatedAt       string
	Version         int64
	Decision        string
}

type CreateAPITokenParams

type CreateAPITokenParams struct {
	ID        string
	MemberID  string
	Name      string
	TokenHash string
	Scope     string
	CreatedAt string
}

type CreateAuditParams

type CreateAuditParams struct {
	ID         string
	At         string
	ActorKind  string
	ActorID    string
	ActorLabel string
	Action     string
	Entity     string
	EntityID   string
	Before     string
	After      string
}

type CreateCategoryParams

type CreateCategoryParams struct {
	ID          string
	HouseholdID string
	Name        string
	Color       string
}

type CreateFileParams

type CreateFileParams struct {
	ID             string
	HouseholdID    string
	SubscriptionID string
	ChargeID       string
	Kind           string
	Name           string
	MediaType      string
	Size           int64
	Sha256         string
	CreatedAt      string
	CreatedBy      string
	Data           []byte
}

type CreateHouseholdParams

type CreateHouseholdParams struct {
	ID        string
	Name      string
	Currency  string
	Timezone  string
	Locale    string
	CreatedAt string
}

type CreateInviteParams

type CreateInviteParams struct {
	CodeHash    string
	HouseholdID string
	Role        string
	CreatedBy   string
	ExpiresAt   string
}

type CreateLinkCodeParams

type CreateLinkCodeParams struct {
	CodeHash  string
	MemberID  string
	Channel   string
	ExpiresAt string
}

type CreateMemberParams

type CreateMemberParams struct {
	ID           string
	HouseholdID  string
	Name         string
	Email        string
	Role         string
	PasswordHash string
	CreatedAt    string
}

type CreateOAuthClientParams

type CreateOAuthClientParams struct {
	ID           string
	Name         string
	Uri          string
	RedirectUris string
	SecretHash   string
	CreatedAt    string
}

type CreateOAuthCodeParams

type CreateOAuthCodeParams struct {
	CodeHash       string
	ClientID       string
	MemberID       string
	RedirectUri    string
	CodeChallenge  string
	Scope          string
	Resource       string
	SessionVersion int64
	ExpiresAt      string
}

type CreateOAuthGrantParams

type CreateOAuthGrantParams struct {
	ID             string
	MemberID       string
	ClientID       string
	Scope          string
	Resource       string
	SessionVersion int64
	CreatedAt      string
}

type CreateOAuthTokenParams

type CreateOAuthTokenParams struct {
	TokenHash string
	GrantID   string
	Kind      string
	CreatedAt string
	ExpiresAt string
}

type CreatePaymentMethodParams

type CreatePaymentMethodParams struct {
	ID          string
	HouseholdID string
	Name        string
	Kind        string
	Last4       string
	ExpiresOn   *string
	OwnerID     *string
}

type CreateSubscriptionParams

type CreateSubscriptionParams struct {
	ID              string
	HouseholdID     string
	Name            string
	PriceMinor      int64
	Currency        string
	Schedule        string
	CategoryID      *string
	PaymentMethodID *string
	PayerID         *string
	Visibility      string
	Status          string
	Url             string
	Notes           string
	AutoConfirm     int64
	Reminders       string
	Details         string
	CreatedBy       string
	CreatedAt       string
	UpdatedAt       string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteCategoryParams

type DeleteCategoryParams struct {
	ID          string
	HouseholdID string
}

type DeleteChannelLinkParams

type DeleteChannelLinkParams struct {
	ID       string
	MemberID string
}

type DeleteFuturePendingChargesParams

type DeleteFuturePendingChargesParams struct {
	SubscriptionID string
	OriginalDate   string
}

type DeleteIdleOAuthClientsParams

type DeleteIdleOAuthClientsParams struct {
	UnusedBefore string
	IdleBefore   *string
}

type DeleteMemberParams

type DeleteMemberParams struct {
	ID          string
	HouseholdID string
}

type DeletePaymentMethodParams

type DeletePaymentMethodParams struct {
	ID          string
	HouseholdID string
}

type DeleteSubscriptionParams

type DeleteSubscriptionParams struct {
	ID          string
	HouseholdID string
}

type DismissFindingParams

type DismissFindingParams struct {
	HouseholdID string
	Kind        string
	Key         string
	MemberID    *string
	CreatedAt   string
}

type DismissedFinding

type DismissedFinding struct {
	HouseholdID string
	Kind        string
	Key         string
	MemberID    *string
	CreatedAt   string
}

type EnableTOTPParams

type EnableTOTPParams struct {
	EnabledAt *string
	Step      int64
	MemberID  string
	Secret    string
}

type EnqueueNoticeParams

type EnqueueNoticeParams struct {
	ID        string
	Kind      string
	DedupeKey string
	MemberID  *string
	Ref       string
	DueAt     string
	CreatedAt string
}

type EnqueueOutboxParams

type EnqueueOutboxParams struct {
	ID        string
	Kind      string
	DedupeKey string
	ChargeID  *string
	MemberID  *string
	DueAt     string
	CreatedAt string
}

type File

type File struct {
	ID             string
	HouseholdID    string
	SubscriptionID string
	ChargeID       string
	Kind           string
	Name           string
	MediaType      string
	Size           int64
	Sha256         string
	CreatedAt      string
	CreatedBy      string
	DeletedAt      string
	Data           []byte
}

type FindSessionParams

type FindSessionParams struct {
	Token  string
	Expiry string
}

type Flow

type Flow struct {
	ID        string
	MemberID  string
	State     string
	ExpiresAt string
	CreatedAt string
}

type FxRate

type FxRate struct {
	Day      string
	Currency string
	Rate     string
	Source   string
}

type FxRateOnOrBeforeParams

type FxRateOnOrBeforeParams struct {
	Currency string
	Day      string
}

type FxRateOnOrBeforeRow

type FxRateOnOrBeforeRow struct {
	Rate string
	Day  string
}

type GetChargeByOriginalDateParams

type GetChargeByOriginalDateParams struct {
	SubscriptionID string
	OriginalDate   string
}

type GetFileDataParams

type GetFileDataParams struct {
	ID          string
	HouseholdID string
}

type GetFileMetaParams

type GetFileMetaParams struct {
	ID          string
	HouseholdID string
}

type GetFileMetaRow

type GetFileMetaRow struct {
	ID             string
	HouseholdID    string
	SubscriptionID string
	ChargeID       string
	Kind           string
	Name           string
	MediaType      string
	Size           int64
	Sha256         string
	CreatedAt      string
	CreatedBy      string
	DeletedAt      string
}

type GetInviteParams

type GetInviteParams struct {
	CodeHash  string
	ExpiresAt string
}

type GetLogoParams

type GetLogoParams struct {
	SubscriptionID string
	HouseholdID    string
}

type GetLogoRow

type GetLogoRow struct {
	ID             string
	HouseholdID    string
	SubscriptionID string
	ChargeID       string
	Kind           string
	Name           string
	MediaType      string
	Size           int64
	Sha256         string
	CreatedAt      string
	CreatedBy      string
	DeletedAt      string
}

type GetMessageParams

type GetMessageParams struct {
	Channel   string
	ChatID    string
	MessageID string
}

type GetOAuthAccessRow

type GetOAuthAccessRow struct {
	ExpiresAt     string
	GrantID       string
	MemberID      string
	ClientID      string
	Scope         string
	Resource      string
	GrantVersion  int64
	MemberVersion int64
	HouseholdID   string
	ClientName    string
}

type GetPaymentMethodParams

type GetPaymentMethodParams struct {
	ID          string
	HouseholdID string
}

type GetPushSubscriptionRow

type GetPushSubscriptionRow struct {
	LinkID   string
	MemberID string
	P256dh   string
	Auth     string
	Device   string
}

type GetSubscriptionParams

type GetSubscriptionParams struct {
	ID          string
	HouseholdID string
}

type Household

type Household struct {
	ID               string
	Name             string
	Currency         string
	Timezone         string
	Locale           string
	CreatedAt        string
	ReminderHour     int64
	ReminderMinute   int64
	Payday           int64
	ConfirmTimes     int64
	ConfirmEveryDays int64
}

type InsertAssistantUsageParams

type InsertAssistantUsageParams struct {
	ID           string
	HouseholdID  string
	MemberID     string
	At           string
	Kind         string
	Surface      string
	Provider     string
	Model        string
	Rounds       int64
	InputTokens  int64
	OutputTokens int64
	CostMicros   *int64
	Failed       int64
}

type InsertChargeIfMissingParams

type InsertChargeIfMissingParams struct {
	ID             string
	SubscriptionID string
	OriginalDate   string
	DueDate        string
	AmountMinor    int64
	Currency       string
	UpdatedAt      string
}

type Invite

type Invite struct {
	CodeHash    string
	HouseholdID string
	Role        string
	CreatedBy   string
	ExpiresAt   string
	UsedAt      *string
}

type LinkChannelParams

type LinkChannelParams struct {
	ID         string
	MemberID   string
	Channel    string
	ExternalID string
	CreatedAt  string
}

type LinkCode

type LinkCode struct {
	CodeHash  string
	MemberID  string
	Channel   string
	ExpiresAt string
}

type LinkMemberIdentityParams

type LinkMemberIdentityParams struct {
	Issuer  string
	Subject string
	ID      string
}

type ListAppMessagesForChatParams

type ListAppMessagesForChatParams struct {
	Channel string
	ChatID  string
}

type ListAssistantUsageParams

type ListAssistantUsageParams struct {
	HouseholdID string
	MemberID    interface{}
	Lim         int64
}

type ListAssistantUsageRow

type ListAssistantUsageRow struct {
	ID           string
	HouseholdID  string
	MemberID     string
	At           string
	Kind         string
	Surface      string
	Provider     string
	Model        string
	Rounds       int64
	InputTokens  int64
	OutputTokens int64
	CostMicros   *int64
	Failed       int64
	MemberName   string
}

type ListChargesBetweenParams

type ListChargesBetweenParams struct {
	HouseholdID string
	FromDate    string
	ToDate      string
}

type ListChargesForSubscriptionParams

type ListChargesForSubscriptionParams struct {
	SubscriptionID string
	Limit          int64
}

type ListDismissedFindingsParams

type ListDismissedFindingsParams struct {
	HouseholdID string
	Kind        string
}

type ListDocumentsParams

type ListDocumentsParams struct {
	SubscriptionID string
	HouseholdID    string
}

type ListDocumentsRow

type ListDocumentsRow struct {
	ID             string
	HouseholdID    string
	SubscriptionID string
	ChargeID       string
	Kind           string
	Name           string
	MediaType      string
	Size           int64
	Sha256         string
	CreatedAt      string
	CreatedBy      string
	DeletedAt      string
}

type ListFilesForExportRow

type ListFilesForExportRow struct {
	ID             string
	HouseholdID    string
	SubscriptionID string
	ChargeID       string
	Kind           string
	Name           string
	MediaType      string
	Size           int64
	Sha256         string
	CreatedAt      string
	CreatedBy      string
	DeletedAt      string
}

type ListOAuthGrantsOfSameAppParams

type ListOAuthGrantsOfSameAppParams struct {
	MemberID     string
	Resource     string
	Name         string
	RedirectUris string
}

type ListOAuthGrantsParams

type ListOAuthGrantsParams struct {
	MemberID string
	Now      string
}

type ListOAuthGrantsRow

type ListOAuthGrantsRow struct {
	ID           string
	Scope        string
	Resource     string
	CreatedAt    string
	LastUsedAt   *string
	ClientID     string
	ClientKind   string
	ClientName   string
	ClientUri    string
	RedirectUris string
}

type ListOpenChargesDueBeforeParams

type ListOpenChargesDueBeforeParams struct {
	HouseholdID string
	Before      string
}

type ListOutboxDueParams

type ListOutboxDueParams struct {
	DueAt string
	Limit int64
}

type ListOutboxForChargeKindParams

type ListOutboxForChargeKindParams struct {
	ChargeID *string
	Kind     string
}

type ListOutboxForChargeKindRow

type ListOutboxForChargeKindRow struct {
	DedupeKey string
	DueAt     string
	Status    string
	MemberID  *string
}

type ListOutboxForHouseholdParams

type ListOutboxForHouseholdParams struct {
	HouseholdID string
	Limit       int64
}

type ListOutboxForHouseholdRow

type ListOutboxForHouseholdRow struct {
	ID               string
	Kind             string
	Status           string
	DueAt            string
	SentAt           *string
	Attempts         int64
	LastError        string
	MemberID         *string
	ChargeID         string
	ChargeDue        string
	SubscriptionID   string
	SubscriptionName string
}

type ListPaidChargesBetweenParams

type ListPaidChargesBetweenParams struct {
	HouseholdID string
	FromDate    string
	ToDate      string
}

type MarkAuditUndoneParams

type MarkAuditUndoneParams struct {
	UndoneBy string
	ID       string
}

type MarkOutboxAttemptFailedParams

type MarkOutboxAttemptFailedParams struct {
	LastError string
	DueAt     string
	Attempts  int64
	ID        string
}

type MarkOutboxObsoleteParams

type MarkOutboxObsoleteParams struct {
	LastError string
	ID        string
}

type MarkOutboxSentParams

type MarkOutboxSentParams struct {
	SentAt *string
	ID     string
}

type MarkOutboxUndeliverableParams

type MarkOutboxUndeliverableParams struct {
	LastError string
	ID        string
}

type Member

type Member struct {
	ID             string
	HouseholdID    string
	Name           string
	Email          string
	Role           string
	PasswordHash   string
	CreatedAt      string
	SessionVersion int64
	OidcIssuer     string
	OidcSubject    string
	Locale         string
}

type MemberBackupCode

type MemberBackupCode struct {
	MemberID string
	CodeHash string
	UsedAt   *string
}

type MemberByIdentityParams

type MemberByIdentityParams struct {
	OidcIssuer  string
	OidcSubject string
}

type MemberForChannelParams

type MemberForChannelParams struct {
	Channel    string
	ExternalID string
}

type MemberTotp

type MemberTotp struct {
	MemberID  string
	Secret    string
	CreatedAt string
	EnabledAt *string
	LastStep  int64
}

type Message

type Message struct {
	ID        string
	Channel   string
	ChatID    string
	MessageID string
	ChargeID  *string
	MemberID  *string
	CreatedAt string
	Kind      string
	Route     string
}

type OauthClient

type OauthClient struct {
	ID           string
	Kind         string
	Name         string
	Uri          string
	RedirectUris string
	SecretHash   string
	CreatedAt    string
	LastUsedAt   *string
	FreshUntil   *string
}

type OauthCode

type OauthCode struct {
	CodeHash       string
	ClientID       string
	MemberID       string
	RedirectUri    string
	CodeChallenge  string
	Scope          string
	Resource       string
	SessionVersion int64
	ExpiresAt      string
	UsedAt         *string
	GrantID        *string
}

type OauthGrant

type OauthGrant struct {
	ID             string
	MemberID       string
	ClientID       string
	Scope          string
	Resource       string
	SessionVersion int64
	CreatedAt      string
	LastUsedAt     *string
}

type OauthToken

type OauthToken struct {
	TokenHash string
	GrantID   string
	Kind      string
	CreatedAt string
	ExpiresAt string
	UsedAt    *string
}

type Outbox

type Outbox struct {
	ID        string
	Kind      string
	DedupeKey string
	ChargeID  *string
	MemberID  *string
	DueAt     string
	Status    string
	Attempts  int64
	LastError string
	SentAt    *string
	CreatedAt string
	Ref       string
}

type PaymentMethod

type PaymentMethod struct {
	ID          string
	HouseholdID string
	Name        string
	Kind        string
	Last4       string
	ExpiresOn   *string
	OwnerID     *string
}

type PushSubscription

type PushSubscription struct {
	LinkID    string
	P256dh    string
	Auth      string
	Device    string
	CreatedAt string
}

type PutPendingTOTPParams

type PutPendingTOTPParams struct {
	MemberID  string
	Secret    string
	CreatedAt string
}

type PutSettingParams

type PutSettingParams struct {
	Key   string
	Value string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddBackupCode

func (q *Queries) AddBackupCode(ctx context.Context, arg AddBackupCodeParams) error

func (*Queries) BumpSessionVersion

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

Signs a member out of every session (turning two-factor on).

func (*Queries) CancelOutboxForCharge

func (q *Queries) CancelOutboxForCharge(ctx context.Context, chargeID *string) error

func (*Queries) CancelOutboxKey

func (q *Queries) CancelOutboxKey(ctx context.Context, dedupeKey string) error

func (*Queries) CancelOutboxKindForCharge

func (q *Queries) CancelOutboxKindForCharge(ctx context.Context, arg CancelOutboxKindForChargeParams) error

func (*Queries) CancelOutboxRef

func (q *Queries) CancelOutboxRef(ctx context.Context, arg CancelOutboxRefParams) error

func (*Queries) ChannelLinksForMember

func (q *Queries) ChannelLinksForMember(ctx context.Context, memberID string) ([]ChannelLink, error)

func (*Queries) CountBackupCodesLeft

func (q *Queries) CountBackupCodesLeft(ctx context.Context, memberID string) (int64, error)

func (*Queries) CountMembersWithLogin

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

func (*Queries) CountOAuthDynamicClients

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

func (*Queries) CountOwners

func (q *Queries) CountOwners(ctx context.Context, householdID string) (int64, error)

func (*Queries) CreateAPIToken

func (q *Queries) CreateAPIToken(ctx context.Context, arg CreateAPITokenParams) error

func (*Queries) CreateAudit

func (q *Queries) CreateAudit(ctx context.Context, arg CreateAuditParams) error

func (*Queries) CreateCategory

func (q *Queries) CreateCategory(ctx context.Context, arg CreateCategoryParams) error

func (*Queries) CreateFile

func (q *Queries) CreateFile(ctx context.Context, arg CreateFileParams) error

ADR 0027: logos and documents. Listing queries never read the data column.

func (*Queries) CreateHousehold

func (q *Queries) CreateHousehold(ctx context.Context, arg CreateHouseholdParams) error

func (*Queries) CreateInvite

func (q *Queries) CreateInvite(ctx context.Context, arg CreateInviteParams) error

func (*Queries) CreateLinkCode

func (q *Queries) CreateLinkCode(ctx context.Context, arg CreateLinkCodeParams) error

func (*Queries) CreateMember

func (q *Queries) CreateMember(ctx context.Context, arg CreateMemberParams) error

func (*Queries) CreateOAuthClient

func (q *Queries) CreateOAuthClient(ctx context.Context, arg CreateOAuthClientParams) error

OAuth 2.1 authorization server for remote MCP (ADR 0024).

func (*Queries) CreateOAuthCode

func (q *Queries) CreateOAuthCode(ctx context.Context, arg CreateOAuthCodeParams) error

func (*Queries) CreateOAuthGrant

func (q *Queries) CreateOAuthGrant(ctx context.Context, arg CreateOAuthGrantParams) error

func (*Queries) CreateOAuthToken

func (q *Queries) CreateOAuthToken(ctx context.Context, arg CreateOAuthTokenParams) error

func (*Queries) CreatePaymentMethod

func (q *Queries) CreatePaymentMethod(ctx context.Context, arg CreatePaymentMethodParams) error

func (*Queries) CreateSubscription

func (q *Queries) CreateSubscription(ctx context.Context, arg CreateSubscriptionParams) error

func (*Queries) DeleteAssistantUsageBefore

func (q *Queries) DeleteAssistantUsageBefore(ctx context.Context, at string) error

func (*Queries) DeleteBackupCodes

func (q *Queries) DeleteBackupCodes(ctx context.Context, memberID string) error

func (*Queries) DeleteCategory

func (q *Queries) DeleteCategory(ctx context.Context, arg DeleteCategoryParams) error
func (q *Queries) DeleteChannelLink(ctx context.Context, arg DeleteChannelLinkParams) (int64, error)

func (*Queries) DeleteDeadOAuthGrants

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

Grants with no token left, and grants ended by a password change.

func (*Queries) DeleteExpiredFlows

func (q *Queries) DeleteExpiredFlows(ctx context.Context, expiresAt string) error

func (*Queries) DeleteExpiredOAuthCodes

func (q *Queries) DeleteExpiredOAuthCodes(ctx context.Context, expiresAt string) error

func (*Queries) DeleteExpiredOAuthTokens

func (q *Queries) DeleteExpiredOAuthTokens(ctx context.Context, expiresAt string) error

func (*Queries) DeleteExpiredSessions

func (q *Queries) DeleteExpiredSessions(ctx context.Context, expiry string) error

func (*Queries) DeleteFlow

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

func (*Queries) DeleteFuturePendingCharges

func (q *Queries) DeleteFuturePendingCharges(ctx context.Context, arg DeleteFuturePendingChargesParams) error

func (*Queries) DeleteIdleOAuthClients

func (q *Queries) DeleteIdleOAuthClients(ctx context.Context, arg DeleteIdleOAuthClientsParams) error

Clients without grants: registrations nobody approved, registrations not used for a long time, and cached metadata documents.

func (*Queries) DeleteMember

func (q *Queries) DeleteMember(ctx context.Context, arg DeleteMemberParams) error

func (*Queries) DeleteOAuthGrant

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

func (*Queries) DeleteOAuthToken

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

func (*Queries) DeletePaymentMethod

func (q *Queries) DeletePaymentMethod(ctx context.Context, arg DeletePaymentMethodParams) error

func (*Queries) DeletePushEndpoint

func (q *Queries) DeletePushEndpoint(ctx context.Context, externalID string) error

func (*Queries) DeleteSession

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

func (*Queries) DeleteSetting

func (q *Queries) DeleteSetting(ctx context.Context, key string) error

func (*Queries) DeleteSubscription

func (q *Queries) DeleteSubscription(ctx context.Context, arg DeleteSubscriptionParams) error

func (*Queries) DeleteTOTP

func (q *Queries) DeleteTOTP(ctx context.Context, memberID string) (int64, error)

func (*Queries) DismissFinding

func (q *Queries) DismissFinding(ctx context.Context, arg DismissFindingParams) error

func (*Queries) EnableTOTP

func (q *Queries) EnableTOTP(ctx context.Context, arg EnableTOTPParams) (int64, error)

func (*Queries) EnqueueNotice

func (q *Queries) EnqueueNotice(ctx context.Context, arg EnqueueNoticeParams) error

Reminders that end in an answer: snoozes, repeats, notices that are not about a charge.

func (*Queries) EnqueueOutbox

func (q *Queries) EnqueueOutbox(ctx context.Context, arg EnqueueOutboxParams) error

A pending reminder follows changes of its time (reminder settings); one already retried keeps its backoff.

func (*Queries) EvictOAuthClient

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

Makes room for a new registration: drops the oldest one nobody ever approved.

func (*Queries) FindSession

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

func (*Queries) FirstHousehold

func (q *Queries) FirstHousehold(ctx context.Context) (Household, error)

func (*Queries) FxRateOnOrBefore

func (q *Queries) FxRateOnOrBefore(ctx context.Context, arg FxRateOnOrBeforeParams) (FxRateOnOrBeforeRow, error)

func (*Queries) GetAPITokenByHash

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

func (*Queries) GetAudit

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

func (*Queries) GetCharge

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

func (*Queries) GetChargeByOriginalDate

func (q *Queries) GetChargeByOriginalDate(ctx context.Context, arg GetChargeByOriginalDateParams) (Charge, error)

func (*Queries) GetFileData

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

func (*Queries) GetFileMeta

func (q *Queries) GetFileMeta(ctx context.Context, arg GetFileMetaParams) (GetFileMetaRow, error)

func (*Queries) GetFlow

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

func (*Queries) GetHousehold

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

func (*Queries) GetInvite

func (q *Queries) GetInvite(ctx context.Context, arg GetInviteParams) (Invite, error)
func (q *Queries) GetLogo(ctx context.Context, arg GetLogoParams) (GetLogoRow, error)

func (*Queries) GetMember

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

func (*Queries) GetMessage

func (q *Queries) GetMessage(ctx context.Context, arg GetMessageParams) (Message, error)

func (*Queries) GetOAuthAccess

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

Everything needed to accept an access token, in one read.

func (*Queries) GetOAuthClient

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

func (*Queries) GetOAuthCode

func (q *Queries) GetOAuthCode(ctx context.Context, codeHash string) (OauthCode, error)

func (*Queries) GetOAuthGrant

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

func (*Queries) GetOAuthToken

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

func (*Queries) GetPaymentMethod

func (q *Queries) GetPaymentMethod(ctx context.Context, arg GetPaymentMethodParams) (PaymentMethod, error)

func (*Queries) GetPushSubscription

func (q *Queries) GetPushSubscription(ctx context.Context, externalID string) (GetPushSubscriptionRow, error)

func (*Queries) GetSetting

func (q *Queries) GetSetting(ctx context.Context, key string) (string, error)

func (*Queries) GetSubscription

func (q *Queries) GetSubscription(ctx context.Context, arg GetSubscriptionParams) (Subscription, error)

func (*Queries) GetTOTP

func (q *Queries) GetTOTP(ctx context.Context, memberID string) (MemberTotp, error)

Two-factor sign-in (ADR 0025).

func (*Queries) HouseholdFilesSize

func (q *Queries) HouseholdFilesSize(ctx context.Context, householdID string) (int64, error)

func (*Queries) InsertAssistantUsage

func (q *Queries) InsertAssistantUsage(ctx context.Context, arg InsertAssistantUsageParams) error

func (*Queries) InsertChargeIfMissing

func (q *Queries) InsertChargeIfMissing(ctx context.Context, arg InsertChargeIfMissingParams) error

func (*Queries) LinkChannel

func (q *Queries) LinkChannel(ctx context.Context, arg LinkChannelParams) error

func (*Queries) LinkMemberIdentity

func (q *Queries) LinkMemberIdentity(ctx context.Context, arg LinkMemberIdentityParams) (int64, error)

Links a member that has no identity, or one of another provider (a dead link after the instance moved providers). Never replaces a link to the same provider.

func (*Queries) ListAPITokens

func (q *Queries) ListAPITokens(ctx context.Context, memberID string) ([]ApiToken, error)

func (*Queries) ListActiveSubscriptions

func (q *Queries) ListActiveSubscriptions(ctx context.Context) ([]Subscription, error)

func (*Queries) ListAppMessagesForChat

func (q *Queries) ListAppMessagesForChat(ctx context.Context, arg ListAppMessagesForChatParams) ([]Message, error)

func (*Queries) ListAssistantUsage

func (q *Queries) ListAssistantUsage(ctx context.Context, arg ListAssistantUsageParams) ([]ListAssistantUsageRow, error)

func (*Queries) ListAudit

func (q *Queries) ListAudit(ctx context.Context, limit int64) ([]AuditLog, error)

func (*Queries) ListCategories

func (q *Queries) ListCategories(ctx context.Context, householdID string) ([]Category, error)

func (*Queries) ListChargesBetween

func (q *Queries) ListChargesBetween(ctx context.Context, arg ListChargesBetweenParams) ([]Charge, error)

func (*Queries) ListChargesForHousehold

func (q *Queries) ListChargesForHousehold(ctx context.Context, householdID string) ([]Charge, error)

func (*Queries) ListChargesForSubscription

func (q *Queries) ListChargesForSubscription(ctx context.Context, arg ListChargesForSubscriptionParams) ([]Charge, error)

func (*Queries) ListDismissedFindings

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

func (*Queries) ListDocuments

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

func (*Queries) ListFilesForExport

func (q *Queries) ListFilesForExport(ctx context.Context, householdID string) ([]ListFilesForExportRow, error)

func (*Queries) ListLiveAppMessages

func (q *Queries) ListLiveAppMessages(ctx context.Context) ([]Message, error)

func (*Queries) ListMembers

func (q *Queries) ListMembers(ctx context.Context, householdID string) ([]Member, error)

func (*Queries) ListMessagesForCharge

func (q *Queries) ListMessagesForCharge(ctx context.Context, chargeID *string) ([]Message, error)

func (*Queries) ListOAuthGrants

func (q *Queries) ListOAuthGrants(ctx context.Context, arg ListOAuthGrantsParams) ([]ListOAuthGrantsRow, error)

The applications a member has connected: grants that still have a token that works.

func (*Queries) ListOAuthGrantsOfSameApp

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

Cloud assistants register again each time they connect. A member's earlier connections of a self-registered application with the same name and redirect URIs are the same application connecting again.

func (*Queries) ListOpenChargesDueBefore

func (q *Queries) ListOpenChargesDueBefore(ctx context.Context, arg ListOpenChargesDueBeforeParams) ([]Charge, error)

func (*Queries) ListOutbox

func (q *Queries) ListOutbox(ctx context.Context, limit int64) ([]Outbox, error)

func (*Queries) ListOutboxDue

func (q *Queries) ListOutboxDue(ctx context.Context, arg ListOutboxDueParams) ([]Outbox, error)

func (*Queries) ListOutboxForChargeKind

func (q *Queries) ListOutboxForChargeKind(ctx context.Context, arg ListOutboxForChargeKindParams) ([]ListOutboxForChargeKindRow, error)

func (*Queries) ListOutboxForHousehold

func (q *Queries) ListOutboxForHousehold(ctx context.Context, arg ListOutboxForHouseholdParams) ([]ListOutboxForHouseholdRow, error)

func (*Queries) ListPaidChargesBetween

func (q *Queries) ListPaidChargesBetween(ctx context.Context, arg ListPaidChargesBetweenParams) ([]Charge, error)

func (*Queries) ListPaymentMethods

func (q *Queries) ListPaymentMethods(ctx context.Context, householdID string) ([]PaymentMethod, error)

func (*Queries) ListSubscriptions

func (q *Queries) ListSubscriptions(ctx context.Context, householdID string) ([]Subscription, error)

func (*Queries) ListTwoFactorMembers

func (q *Queries) ListTwoFactorMembers(ctx context.Context, householdID string) ([]string, error)

func (*Queries) MarkAuditUndone

func (q *Queries) MarkAuditUndone(ctx context.Context, arg MarkAuditUndoneParams) error

func (*Queries) MarkOutboxAttemptFailed

func (q *Queries) MarkOutboxAttemptFailed(ctx context.Context, arg MarkOutboxAttemptFailedParams) error

func (*Queries) MarkOutboxObsolete

func (q *Queries) MarkOutboxObsolete(ctx context.Context, arg MarkOutboxObsoleteParams) error

func (*Queries) MarkOutboxSent

func (q *Queries) MarkOutboxSent(ctx context.Context, arg MarkOutboxSentParams) error

func (*Queries) MarkOutboxUndeliverable

func (q *Queries) MarkOutboxUndeliverable(ctx context.Context, arg MarkOutboxUndeliverableParams) error

func (*Queries) MemberByEmail

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

func (*Queries) MemberByIdentity

func (q *Queries) MemberByIdentity(ctx context.Context, arg MemberByIdentityParams) (Member, error)

func (*Queries) MemberForChannel

func (q *Queries) MemberForChannel(ctx context.Context, arg MemberForChannelParams) (string, error)

func (*Queries) NextOutboxDue

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

func (*Queries) PurgeFiles

func (q *Queries) PurgeFiles(ctx context.Context, deletedAt string) (int64, error)
func (q *Queries) PushLink(ctx context.Context, externalID string) (ChannelLink, error)

func (*Queries) PutPendingTOTP

func (q *Queries) PutPendingTOTP(ctx context.Context, arg PutPendingTOTPParams) (int64, error)

Starts or restarts an enrolment. Never replaces a secret that is on.

func (*Queries) PutSetting

func (q *Queries) PutSetting(ctx context.Context, arg PutSettingParams) error

func (*Queries) ReassignPayer

func (q *Queries) ReassignPayer(ctx context.Context, arg ReassignPayerParams) error

func (*Queries) ReassignPaymentMethod

func (q *Queries) ReassignPaymentMethod(ctx context.Context, arg ReassignPaymentMethodParams) (int64, error)

func (*Queries) RestoreCharge

func (q *Queries) RestoreCharge(ctx context.Context, arg RestoreChargeParams) error

func (*Queries) RestoreFile

func (q *Queries) RestoreFile(ctx context.Context, arg RestoreFileParams) error

func (*Queries) RetireAppMessage

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

func (*Queries) RevokeAPIToken

func (q *Queries) RevokeAPIToken(ctx context.Context, arg RevokeAPITokenParams) (int64, error)

func (*Queries) SaveAppMessage

func (q *Queries) SaveAppMessage(ctx context.Context, arg SaveAppMessageParams) error

func (*Queries) SaveFlow

func (q *Queries) SaveFlow(ctx context.Context, arg SaveFlowParams) error

func (*Queries) SaveMessage

func (q *Queries) SaveMessage(ctx context.Context, arg SaveMessageParams) error

func (*Queries) SaveOAuthMetadataClient

func (q *Queries) SaveOAuthMetadataClient(ctx context.Context, arg SaveOAuthMetadataClientParams) error

The cached copy of a client metadata document, replaced on every fetch.

func (*Queries) SavePushSubscription

func (q *Queries) SavePushSubscription(ctx context.Context, arg SavePushSubscriptionParams) error

ADR 0026: Web Push devices.

func (*Queries) SaveSession

func (q *Queries) SaveSession(ctx context.Context, arg SaveSessionParams) error

func (*Queries) SetHouseholdConfirmRepeat

func (q *Queries) SetHouseholdConfirmRepeat(ctx context.Context, arg SetHouseholdConfirmRepeatParams) error

func (*Queries) SetMemberCredentials

func (q *Queries) SetMemberCredentials(ctx context.Context, arg SetMemberCredentialsParams) error

func (*Queries) SetMemberLocale

func (q *Queries) SetMemberLocale(ctx context.Context, arg SetMemberLocaleParams) error

func (*Queries) SetMemberPassword

func (q *Queries) SetMemberPassword(ctx context.Context, arg SetMemberPasswordParams) error

func (*Queries) SetMemberProfile

func (q *Queries) SetMemberProfile(ctx context.Context, arg SetMemberProfileParams) error

func (*Queries) SetMessageRoute

func (q *Queries) SetMessageRoute(ctx context.Context, arg SetMessageRouteParams) error

func (*Queries) SetOAuthCodeGrant

func (q *Queries) SetOAuthCodeGrant(ctx context.Context, arg SetOAuthCodeGrantParams) error

func (*Queries) SumAssistantUsage

func (q *Queries) SumAssistantUsage(ctx context.Context, arg SumAssistantUsageParams) (SumAssistantUsageRow, error)

func (*Queries) TakeLinkCode

func (q *Queries) TakeLinkCode(ctx context.Context, arg TakeLinkCodeParams) (string, error)

func (*Queries) TouchAPIToken

func (q *Queries) TouchAPIToken(ctx context.Context, arg TouchAPITokenParams) error

func (*Queries) TouchOAuthClient

func (q *Queries) TouchOAuthClient(ctx context.Context, arg TouchOAuthClientParams) error

func (*Queries) TouchOAuthGrant

func (q *Queries) TouchOAuthGrant(ctx context.Context, arg TouchOAuthGrantParams) error

At most one write per minute and grant, however busy the assistant is.

func (*Queries) TrashFile

func (q *Queries) TrashFile(ctx context.Context, arg TrashFileParams) error

func (*Queries) TrashSubscriptionFiles

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

func (*Queries) UpdateCategory

func (q *Queries) UpdateCategory(ctx context.Context, arg UpdateCategoryParams) error

func (*Queries) UpdateCharge

func (q *Queries) UpdateCharge(ctx context.Context, arg UpdateChargeParams) (int64, error)

func (*Queries) UpdateHousehold

func (q *Queries) UpdateHousehold(ctx context.Context, arg UpdateHouseholdParams) error

func (*Queries) UpdateMemberName

func (q *Queries) UpdateMemberName(ctx context.Context, arg UpdateMemberNameParams) error

func (*Queries) UpdateMemberRole

func (q *Queries) UpdateMemberRole(ctx context.Context, arg UpdateMemberRoleParams) error

func (*Queries) UpdatePaymentMethod

func (q *Queries) UpdatePaymentMethod(ctx context.Context, arg UpdatePaymentMethodParams) error

func (*Queries) UpdateSubscription

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

func (*Queries) UpsertFxRate

func (q *Queries) UpsertFxRate(ctx context.Context, arg UpsertFxRateParams) error

func (*Queries) UseBackupCode

func (q *Queries) UseBackupCode(ctx context.Context, arg UseBackupCodeParams) (int64, error)

func (*Queries) UseInvite

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

func (*Queries) UseOAuthCode

func (q *Queries) UseOAuthCode(ctx context.Context, arg UseOAuthCodeParams) (int64, error)

Single use: only the first caller changes a row.

func (*Queries) UseOAuthToken

func (q *Queries) UseOAuthToken(ctx context.Context, arg UseOAuthTokenParams) (int64, error)

Rotation: only the first caller changes a row.

func (*Queries) UseTOTPStep

func (q *Queries) UseTOTPStep(ctx context.Context, arg UseTOTPStepParams) (int64, error)

Accepts a time step only once and never one older than the last.

func (*Queries) WithTx

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

type ReassignPayerParams

type ReassignPayerParams struct {
	ToID        *string
	UpdatedAt   string
	HouseholdID string
	FromID      *string
}

type ReassignPaymentMethodParams

type ReassignPaymentMethodParams struct {
	ToID        *string
	UpdatedAt   string
	HouseholdID string
	FromID      *string
}

type RestoreChargeParams

type RestoreChargeParams struct {
	ID              string
	SubscriptionID  string
	OriginalDate    string
	DueDate         string
	AmountMinor     int64
	Currency        string
	ChargedMinor    *int64
	ChargedCurrency *string
	Status          string
	ResolvedAt      *string
	Note            string
	Decision        string
	UpdatedAt       string
	Version         int64
}

type RestoreFileParams

type RestoreFileParams struct {
	ID          string
	HouseholdID string
}

type RevokeAPITokenParams

type RevokeAPITokenParams struct {
	RevokedAt *string
	ID        string
	MemberID  string
}

type SaveAppMessageParams

type SaveAppMessageParams struct {
	ID        string
	Channel   string
	ChatID    string
	MessageID string
	MemberID  *string
	Route     string
	CreatedAt string
}

type SaveFlowParams

type SaveFlowParams struct {
	ID        string
	MemberID  string
	State     string
	ExpiresAt string
	CreatedAt string
}

type SaveMessageParams

type SaveMessageParams struct {
	ID        string
	Channel   string
	ChatID    string
	MessageID string
	ChargeID  *string
	MemberID  *string
	CreatedAt string
}

type SaveOAuthMetadataClientParams

type SaveOAuthMetadataClientParams struct {
	ID           string
	Name         string
	Uri          string
	RedirectUris string
	CreatedAt    string
	FreshUntil   *string
}

type SavePushSubscriptionParams

type SavePushSubscriptionParams struct {
	LinkID    string
	P256dh    string
	Auth      string
	Device    string
	CreatedAt string
}

type SaveSessionParams

type SaveSessionParams struct {
	Token  string
	Data   []byte
	Expiry string
}

type Session

type Session struct {
	Token  string
	Data   []byte
	Expiry string
}

type SetHouseholdConfirmRepeatParams

type SetHouseholdConfirmRepeatParams struct {
	ConfirmTimes     int64
	ConfirmEveryDays int64
	ID               string
}

type SetMemberCredentialsParams

type SetMemberCredentialsParams struct {
	Name         string
	Email        string
	PasswordHash string
	ID           string
}

type SetMemberLocaleParams

type SetMemberLocaleParams struct {
	Locale string
	ID     string
}

type SetMemberPasswordParams

type SetMemberPasswordParams struct {
	PasswordHash string
	ID           string
}

type SetMemberProfileParams

type SetMemberProfileParams struct {
	Name  string
	Email string
	ID    string
}

type SetMessageRouteParams

type SetMessageRouteParams struct {
	Route     string
	Channel   string
	ChatID    string
	MessageID string
}

type SetOAuthCodeGrantParams

type SetOAuthCodeGrantParams struct {
	GrantID  *string
	CodeHash string
}

type Setting

type Setting struct {
	Key   string
	Value string
}

type Subscription

type Subscription struct {
	ID              string
	HouseholdID     string
	Name            string
	PriceMinor      int64
	Currency        string
	Schedule        string
	CategoryID      *string
	PaymentMethodID *string
	PayerID         *string
	Visibility      string
	Status          string
	Url             string
	Notes           string
	AutoConfirm     int64
	Reminders       string
	CreatedBy       string
	CreatedAt       string
	UpdatedAt       string
	Version         int64
	Details         string
}

type SumAssistantUsageParams

type SumAssistantUsageParams struct {
	HouseholdID string
	Since       string
	Until       string
}

type SumAssistantUsageRow

type SumAssistantUsageRow struct {
	Questions    int64
	InputTokens  int64
	OutputTokens int64
	CostMicros   int64
	Unpriced     int64
}

type TakeLinkCodeParams

type TakeLinkCodeParams struct {
	CodeHash  string
	Channel   string
	ExpiresAt string
}

type TouchAPITokenParams

type TouchAPITokenParams struct {
	LastUsedAt *string
	ID         string
}

type TouchOAuthClientParams

type TouchOAuthClientParams struct {
	LastUsedAt *string
	ID         string
}

type TouchOAuthGrantParams

type TouchOAuthGrantParams struct {
	Now   *string
	ID    string
	Stale *string
}

type TrashFileParams

type TrashFileParams struct {
	DeletedAt   string
	ID          string
	HouseholdID string
}

type TrashSubscriptionFilesParams

type TrashSubscriptionFilesParams struct {
	DeletedAt      string
	SubscriptionID string
	HouseholdID    string
}

type UpdateCategoryParams

type UpdateCategoryParams struct {
	Name        string
	Color       string
	ID          string
	HouseholdID string
}

type UpdateChargeParams

type UpdateChargeParams struct {
	DueDate         string
	AmountMinor     int64
	Currency        string
	ChargedMinor    *int64
	ChargedCurrency *string
	Status          string
	ResolvedAt      *string
	Note            string
	Decision        string
	UpdatedAt       string
	ID              string
	Version         int64
}

type UpdateHouseholdParams

type UpdateHouseholdParams struct {
	Name           string
	Currency       string
	Timezone       string
	Locale         string
	ReminderHour   int64
	ReminderMinute int64
	Payday         int64
	ID             string
}

type UpdateMemberNameParams

type UpdateMemberNameParams struct {
	Name        string
	ID          string
	HouseholdID string
}

type UpdateMemberRoleParams

type UpdateMemberRoleParams struct {
	Role        string
	ID          string
	HouseholdID string
}

type UpdatePaymentMethodParams

type UpdatePaymentMethodParams struct {
	Name        string
	Kind        string
	Last4       string
	ExpiresOn   *string
	OwnerID     *string
	ID          string
	HouseholdID string
}

type UpdateSubscriptionParams

type UpdateSubscriptionParams struct {
	Name            string
	PriceMinor      int64
	Currency        string
	Schedule        string
	CategoryID      *string
	PaymentMethodID *string
	PayerID         *string
	Visibility      string
	Status          string
	Url             string
	Notes           string
	AutoConfirm     int64
	Reminders       string
	Details         string
	UpdatedAt       string
	ID              string
	HouseholdID     string
	Version         int64
}

type UpsertFxRateParams

type UpsertFxRateParams struct {
	Day      string
	Currency string
	Rate     string
	Source   string
}

type UseBackupCodeParams

type UseBackupCodeParams struct {
	UsedAt   *string
	MemberID string
	CodeHash string
}

type UseInviteParams

type UseInviteParams struct {
	UsedAt   *string
	CodeHash string
}

type UseOAuthCodeParams

type UseOAuthCodeParams struct {
	UsedAt   *string
	CodeHash string
}

type UseOAuthTokenParams

type UseOAuthTokenParams struct {
	UsedAt    *string
	TokenHash string
}

type UseTOTPStepParams

type UseTOTPStepParams struct {
	Step     int64
	MemberID string
}

Jump to

Keyboard shortcuts

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