sqlcgen

package
v0.0.0-...-676fa8b Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppState

type AppState struct {
	Key   string
	Value string
}

type Category

type Category struct {
	ID         int64
	Name       string
	Color      string
	Icon       sql.NullString
	CreatedAt  int64
	IsArchived int64
}

type ClearLedgerOnExpensesParams

type ClearLedgerOnExpensesParams struct {
	UpdatedAt int64
	LedgerID  sql.NullInt64
}

type CreateCategoryParams

type CreateCategoryParams struct {
	Name      string
	Color     string
	Icon      sql.NullString
	CreatedAt int64
}

type CreateExpenseParams

type CreateExpenseParams struct {
	Amount      int64
	Description string
	Notes       sql.NullString
	SpentAt     int64
	CategoryID  sql.NullInt64
	LedgerID    sql.NullInt64
	CreatedAt   int64
	UpdatedAt   int64
}

type CreateLedgerParams

type CreateLedgerParams struct {
	Name         string
	Description  sql.NullString
	BudgetAmount sql.NullInt64
	StartDate    sql.NullInt64
	EndDate      sql.NullInt64
	CreatedAt    int64
	UpdatedAt    int64
}

type CreateOwnerParams

type CreateOwnerParams struct {
	Email          string
	PasswordHash   string
	DisplayName    string
	CurrencyCode   string
	CurrencySymbol string
	Timezone       string
	CreatedAt      int64
	UpdatedAt      int64
}

type CreateSessionParams

type CreateSessionParams struct {
	ID        string
	CreatedAt int64
	ExpiresAt int64
	UserAgent sql.NullString
	IpAddress sql.NullString
}

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 DailySpendingBetweenParams

type DailySpendingBetweenParams struct {
	SpentAt   int64
	SpentAt_2 int64
}

type DailySpendingBetweenRow

type DailySpendingBetweenRow struct {
	Day   int64
	Total int64
}

type DailySpendingForLedgerRow

type DailySpendingForLedgerRow struct {
	Day   int64
	Total int64
}

type Expense

type Expense struct {
	ID          int64
	Amount      int64
	Description string
	Notes       sql.NullString
	SpentAt     int64
	CategoryID  sql.NullInt64
	LedgerID    sql.NullInt64
	CreatedAt   int64
	UpdatedAt   int64
	DeletedAt   sql.NullInt64
}

type GetSessionParams

type GetSessionParams struct {
	ID        string
	ExpiresAt int64
}

type InsertLLMCallLogParams

type InsertLLMCallLogParams struct {
	Provider     string
	Model        string
	Purpose      string
	LatencyMs    int64
	InputTokens  sql.NullInt64
	OutputTokens sql.NullInt64
	Success      int64
	ErrorMessage sql.NullString
	CreatedAt    int64
}

type Ledger

type Ledger struct {
	ID           int64
	Name         string
	Description  sql.NullString
	BudgetAmount sql.NullInt64
	StartDate    sql.NullInt64
	EndDate      sql.NullInt64
	IsArchived   int64
	CreatedAt    int64
	UpdatedAt    int64
}

type ListDeletedExpensesParams

type ListDeletedExpensesParams struct {
	Limit  int64
	Offset int64
}

type ListDeletedExpensesRow

type ListDeletedExpensesRow struct {
	ID            int64
	Amount        int64
	Description   string
	Notes         sql.NullString
	SpentAt       int64
	CategoryID    sql.NullInt64
	LedgerID      sql.NullInt64
	CreatedAt     int64
	UpdatedAt     int64
	DeletedAt     sql.NullInt64
	CategoryName  sql.NullString
	CategoryColor sql.NullString
	LedgerName    sql.NullString
}

type ListExpensesByLedgerRow

type ListExpensesByLedgerRow struct {
	ID            int64
	Amount        int64
	Description   string
	Notes         sql.NullString
	SpentAt       int64
	CategoryID    sql.NullInt64
	LedgerID      sql.NullInt64
	CreatedAt     int64
	UpdatedAt     int64
	CategoryName  sql.NullString
	CategoryColor sql.NullString
}

type ListRecentExpensesRow

type ListRecentExpensesRow struct {
	ID            int64
	Amount        int64
	Description   string
	Notes         sql.NullString
	SpentAt       int64
	CategoryID    sql.NullInt64
	LedgerID      sql.NullInt64
	CreatedAt     int64
	UpdatedAt     int64
	CategoryName  sql.NullString
	CategoryColor sql.NullString
	LedgerName    sql.NullString
}

type LlmCallLog

type LlmCallLog struct {
	ID           int64
	Provider     string
	Model        string
	Purpose      string
	LatencyMs    int64
	InputTokens  sql.NullInt64
	OutputTokens sql.NullInt64
	Success      int64
	ErrorMessage sql.NullString
	CreatedAt    int64
}

type LlmConfig

type LlmConfig struct {
	ID              int64
	Provider        string
	ApiKeyEncrypted sql.NullString
	TextModel       string
	Enabled         int64
	LastTestAt      sql.NullInt64
	LastTestSuccess int64
	LastTestError   sql.NullString
	CreatedAt       int64
	UpdatedAt       int64
}

type Owner

type Owner struct {
	ID                 int64
	Email              string
	PasswordHash       string
	DisplayName        string
	CurrencyCode       string
	CurrencySymbol     string
	Timezone           string
	CreatedAt          int64
	UpdatedAt          int64
	TrashRetentionDays int64
	DashboardUrl       string
}

type Querier

type Querier interface {
	// Counts active (non-trashed) expenses only.
	CategoryExpenseCount(ctx context.Context, categoryID sql.NullInt64) (int64, error)
	ClearLedgerOnExpenses(ctx context.Context, arg ClearLedgerOnExpensesParams) error
	// Disconnecting a chat keeps the bot polling so the user can re-pair from a
	// different Telegram account. The "Disable" button (SetTelegramEnabled) is
	// the only path that flips enabled to 0.
	ClearTelegramChatID(ctx context.Context, updatedAt int64) error
	ClearTelegramPairingCode(ctx context.Context, updatedAt int64) error
	CountDeletedExpenses(ctx context.Context) (int64, error)
	CreateCategory(ctx context.Context, arg CreateCategoryParams) (int64, error)
	CreateExpense(ctx context.Context, arg CreateExpenseParams) (int64, error)
	CreateLedger(ctx context.Context, arg CreateLedgerParams) (int64, error)
	CreateOwner(ctx context.Context, arg CreateOwnerParams) error
	CreateSession(ctx context.Context, arg CreateSessionParams) error
	DailySpendingBetween(ctx context.Context, arg DailySpendingBetweenParams) ([]DailySpendingBetweenRow, error)
	DailySpendingForLedger(ctx context.Context, ledgerID sql.NullInt64) ([]DailySpendingForLedgerRow, error)
	DeleteAllSessions(ctx context.Context) error
	DeleteExpiredSessions(ctx context.Context, expiresAt int64) (int64, error)
	DeleteLLMConfig(ctx context.Context) error
	DeleteLedger(ctx context.Context, id int64) error
	DeleteOldLLMCallLog(ctx context.Context, createdAt int64) (int64, error)
	DeleteSession(ctx context.Context, id string) error
	DeleteTelegramConfig(ctx context.Context) error
	// Hard-deletes every currently soft-deleted row.
	EmptyTrash(ctx context.Context) (int64, error)
	GetAppState(ctx context.Context, key string) (string, error)
	GetCategory(ctx context.Context, id int64) (Category, error)
	// Trash-only fetch: returns the row regardless of state, used by Restore /
	// HardDelete handlers that need to read a soft-deleted row.
	GetDeletedExpense(ctx context.Context, id int64) (Expense, error)
	// Returns only active rows. Trash UI uses GetDeletedExpense for the trash side.
	GetExpense(ctx context.Context, id int64) (Expense, error)
	GetLLMConfig(ctx context.Context) (LlmConfig, error)
	GetLedger(ctx context.Context, id int64) (Ledger, error)
	// Column order matches the table (post-migration: trash_retention_days
	// was ALTER-appended last) so sqlc emits the canonical Owner struct
	// rather than a one-off GetOwnerRow.
	GetOwner(ctx context.Context) (Owner, error)
	GetSession(ctx context.Context, arg GetSessionParams) (Session, error)
	GetTelegramConfig(ctx context.Context) (TelegramConfig, error)
	// Permanent delete. Used by the trash UI's "Delete forever" and by the
	// maintenance sweeper. Restricted to already-trashed rows so a stray call
	// can't bypass the trash.
	HardDeleteExpense(ctx context.Context, id int64) error
	InsertLLMCallLog(ctx context.Context, arg InsertLLMCallLogParams) error
	// Counts active (non-trashed) expenses only.
	LedgerExpenseCount(ctx context.Context, ledgerID sql.NullInt64) (int64, error)
	// Sums active (non-trashed) expenses only.
	LedgerTotalSpent(ctx context.Context, ledgerID sql.NullInt64) (int64, error)
	ListActiveCategories(ctx context.Context) ([]Category, error)
	ListActiveLedgers(ctx context.Context) ([]Ledger, error)
	ListAllCategories(ctx context.Context) ([]Category, error)
	ListAllLedgers(ctx context.Context) ([]Ledger, error)
	ListArchivedLedgers(ctx context.Context) ([]Ledger, error)
	// Trash listing, newest-deleted first.
	ListDeletedExpenses(ctx context.Context, arg ListDeletedExpensesParams) ([]ListDeletedExpensesRow, error)
	ListExpensesByLedger(ctx context.Context, ledgerID sql.NullInt64) ([]ListExpensesByLedgerRow, error)
	ListRecentExpenses(ctx context.Context, limit int64) ([]ListRecentExpensesRow, error)
	// Hard-deletes any soft-deleted rows older than the cutoff. Backs the
	// trash sweeper.
	PurgeOldDeletedExpenses(ctx context.Context, deletedAt sql.NullInt64) (int64, error)
	RecentLLMCallLog(ctx context.Context, limit int64) ([]LlmCallLog, error)
	// Brings a trashed row back. No-op for active rows.
	RestoreExpense(ctx context.Context, arg RestoreExpenseParams) error
	SetAppState(ctx context.Context, arg SetAppStateParams) error
	SetCategoryArchived(ctx context.Context, arg SetCategoryArchivedParams) error
	SetLLMEnabled(ctx context.Context, arg SetLLMEnabledParams) error
	SetLedgerArchived(ctx context.Context, arg SetLedgerArchivedParams) error
	SetTelegramActiveLedger(ctx context.Context, arg SetTelegramActiveLedgerParams) error
	SetTelegramChatID(ctx context.Context, arg SetTelegramChatIDParams) error
	SetTelegramEnabled(ctx context.Context, arg SetTelegramEnabledParams) error
	SetTelegramLastUpdateID(ctx context.Context, arg SetTelegramLastUpdateIDParams) error
	SetTelegramPairingCode(ctx context.Context, arg SetTelegramPairingCodeParams) error
	// Moves the row to trash. Idempotent: deleting an already-deleted row is a no-op.
	SoftDeleteExpense(ctx context.Context, arg SoftDeleteExpenseParams) error
	SpendingByCategoryBetween(ctx context.Context, arg SpendingByCategoryBetweenParams) ([]SpendingByCategoryBetweenRow, error)
	SpendingByCategoryForLedger(ctx context.Context, ledgerID sql.NullInt64) ([]SpendingByCategoryForLedgerRow, error)
	SpendingByLedgerBetween(ctx context.Context, arg SpendingByLedgerBetweenParams) ([]SpendingByLedgerBetweenRow, error)
	SummaryBetween(ctx context.Context, arg SummaryBetweenParams) (SummaryBetweenRow, error)
	TopExpensesBetween(ctx context.Context, arg TopExpensesBetweenParams) ([]TopExpensesBetweenRow, error)
	TotalSpentBetween(ctx context.Context, arg TotalSpentBetweenParams) (int64, error)
	UpdateCategory(ctx context.Context, arg UpdateCategoryParams) error
	UpdateExpense(ctx context.Context, arg UpdateExpenseParams) error
	UpdateLLMTestResult(ctx context.Context, arg UpdateLLMTestResultParams) error
	UpdateLedger(ctx context.Context, arg UpdateLedgerParams) error
	UpdateOwnerPassword(ctx context.Context, arg UpdateOwnerPasswordParams) error
	UpdateOwnerPreferences(ctx context.Context, arg UpdateOwnerPreferencesParams) error
	UpdateOwnerProfile(ctx context.Context, arg UpdateOwnerProfileParams) error
	UpdateOwnerTrashRetention(ctx context.Context, arg UpdateOwnerTrashRetentionParams) error
	UpsertLLMConfig(ctx context.Context, arg UpsertLLMConfigParams) error
	// Saving a bot token enables polling immediately so the bot can RECEIVE the
	// /start <pairing_code> message that completes the pairing. Without this,
	// the supervisor would never start the bot and pairing could never finish.
	UpsertTelegramBot(ctx context.Context, arg UpsertTelegramBotParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CategoryExpenseCount

func (q *Queries) CategoryExpenseCount(ctx context.Context, categoryID sql.NullInt64) (int64, error)

Counts active (non-trashed) expenses only.

func (*Queries) ClearLedgerOnExpenses

func (q *Queries) ClearLedgerOnExpenses(ctx context.Context, arg ClearLedgerOnExpensesParams) error

func (*Queries) ClearTelegramChatID

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

Disconnecting a chat keeps the bot polling so the user can re-pair from a different Telegram account. The "Disable" button (SetTelegramEnabled) is the only path that flips enabled to 0.

func (*Queries) ClearTelegramPairingCode

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

func (*Queries) CountDeletedExpenses

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

func (*Queries) CreateCategory

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

func (*Queries) CreateExpense

func (q *Queries) CreateExpense(ctx context.Context, arg CreateExpenseParams) (int64, error)

func (*Queries) CreateLedger

func (q *Queries) CreateLedger(ctx context.Context, arg CreateLedgerParams) (int64, error)

func (*Queries) CreateOwner

func (q *Queries) CreateOwner(ctx context.Context, arg CreateOwnerParams) error

func (*Queries) CreateSession

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

func (*Queries) DailySpendingBetween

func (q *Queries) DailySpendingBetween(ctx context.Context, arg DailySpendingBetweenParams) ([]DailySpendingBetweenRow, error)

func (*Queries) DailySpendingForLedger

func (q *Queries) DailySpendingForLedger(ctx context.Context, ledgerID sql.NullInt64) ([]DailySpendingForLedgerRow, error)

func (*Queries) DeleteAllSessions

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

func (*Queries) DeleteExpiredSessions

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

func (*Queries) DeleteLLMConfig

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

func (*Queries) DeleteLedger

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

func (*Queries) DeleteOldLLMCallLog

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

func (*Queries) DeleteSession

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

func (*Queries) DeleteTelegramConfig

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

func (*Queries) EmptyTrash

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

Hard-deletes every currently soft-deleted row.

func (*Queries) GetAppState

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

func (*Queries) GetCategory

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

func (*Queries) GetDeletedExpense

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

Trash-only fetch: returns the row regardless of state, used by Restore / HardDelete handlers that need to read a soft-deleted row.

func (*Queries) GetExpense

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

Returns only active rows. Trash UI uses GetDeletedExpense for the trash side.

func (*Queries) GetLLMConfig

func (q *Queries) GetLLMConfig(ctx context.Context) (LlmConfig, error)

func (*Queries) GetLedger

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

func (*Queries) GetOwner

func (q *Queries) GetOwner(ctx context.Context) (Owner, error)

Column order matches the table (post-migration: trash_retention_days and dashboard_url were ALTER-appended last) so sqlc emits the canonical Owner struct rather than a one-off GetOwnerRow.

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, arg GetSessionParams) (Session, error)

func (*Queries) GetTelegramConfig

func (q *Queries) GetTelegramConfig(ctx context.Context) (TelegramConfig, error)

func (*Queries) HardDeleteExpense

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

Permanent delete. Used by the trash UI's "Delete forever" and by the maintenance sweeper. Restricted to already-trashed rows so a stray call can't bypass the trash.

func (*Queries) InsertLLMCallLog

func (q *Queries) InsertLLMCallLog(ctx context.Context, arg InsertLLMCallLogParams) error

func (*Queries) LedgerExpenseCount

func (q *Queries) LedgerExpenseCount(ctx context.Context, ledgerID sql.NullInt64) (int64, error)

Counts active (non-trashed) expenses only.

func (*Queries) LedgerTotalSpent

func (q *Queries) LedgerTotalSpent(ctx context.Context, ledgerID sql.NullInt64) (int64, error)

Sums active (non-trashed) expenses only.

func (*Queries) ListActiveCategories

func (q *Queries) ListActiveCategories(ctx context.Context) ([]Category, error)

func (*Queries) ListActiveLedgers

func (q *Queries) ListActiveLedgers(ctx context.Context) ([]Ledger, error)

func (*Queries) ListAllCategories

func (q *Queries) ListAllCategories(ctx context.Context) ([]Category, error)

func (*Queries) ListAllLedgers

func (q *Queries) ListAllLedgers(ctx context.Context) ([]Ledger, error)

func (*Queries) ListArchivedLedgers

func (q *Queries) ListArchivedLedgers(ctx context.Context) ([]Ledger, error)

func (*Queries) ListDeletedExpenses

func (q *Queries) ListDeletedExpenses(ctx context.Context, arg ListDeletedExpensesParams) ([]ListDeletedExpensesRow, error)

Trash listing, newest-deleted first.

func (*Queries) ListExpensesByLedger

func (q *Queries) ListExpensesByLedger(ctx context.Context, ledgerID sql.NullInt64) ([]ListExpensesByLedgerRow, error)

func (*Queries) ListRecentExpenses

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

func (*Queries) PurgeOldDeletedExpenses

func (q *Queries) PurgeOldDeletedExpenses(ctx context.Context, deletedAt sql.NullInt64) (int64, error)

Hard-deletes any soft-deleted rows older than the cutoff. Backs the trash sweeper.

func (*Queries) RecentLLMCallLog

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

func (*Queries) RestoreExpense

func (q *Queries) RestoreExpense(ctx context.Context, arg RestoreExpenseParams) error

Brings a trashed row back. No-op for active rows.

func (*Queries) SetAppState

func (q *Queries) SetAppState(ctx context.Context, arg SetAppStateParams) error

func (*Queries) SetCategoryArchived

func (q *Queries) SetCategoryArchived(ctx context.Context, arg SetCategoryArchivedParams) error

func (*Queries) SetLLMEnabled

func (q *Queries) SetLLMEnabled(ctx context.Context, arg SetLLMEnabledParams) error

func (*Queries) SetLedgerArchived

func (q *Queries) SetLedgerArchived(ctx context.Context, arg SetLedgerArchivedParams) error

func (*Queries) SetTelegramActiveLedger

func (q *Queries) SetTelegramActiveLedger(ctx context.Context, arg SetTelegramActiveLedgerParams) error

func (*Queries) SetTelegramChatID

func (q *Queries) SetTelegramChatID(ctx context.Context, arg SetTelegramChatIDParams) error

func (*Queries) SetTelegramEnabled

func (q *Queries) SetTelegramEnabled(ctx context.Context, arg SetTelegramEnabledParams) error

func (*Queries) SetTelegramLastUpdateID

func (q *Queries) SetTelegramLastUpdateID(ctx context.Context, arg SetTelegramLastUpdateIDParams) error

func (*Queries) SetTelegramPairingCode

func (q *Queries) SetTelegramPairingCode(ctx context.Context, arg SetTelegramPairingCodeParams) error

func (*Queries) SoftDeleteExpense

func (q *Queries) SoftDeleteExpense(ctx context.Context, arg SoftDeleteExpenseParams) error

Moves the row to trash. Idempotent: deleting an already-deleted row is a no-op.

func (*Queries) SpendingByCategoryBetween

func (q *Queries) SpendingByCategoryBetween(ctx context.Context, arg SpendingByCategoryBetweenParams) ([]SpendingByCategoryBetweenRow, error)

func (*Queries) SpendingByCategoryForLedger

func (q *Queries) SpendingByCategoryForLedger(ctx context.Context, ledgerID sql.NullInt64) ([]SpendingByCategoryForLedgerRow, error)

func (*Queries) SpendingByLedgerBetween

func (q *Queries) SpendingByLedgerBetween(ctx context.Context, arg SpendingByLedgerBetweenParams) ([]SpendingByLedgerBetweenRow, error)

func (*Queries) SummaryBetween

func (q *Queries) SummaryBetween(ctx context.Context, arg SummaryBetweenParams) (SummaryBetweenRow, error)

func (*Queries) TopExpensesBetween

func (q *Queries) TopExpensesBetween(ctx context.Context, arg TopExpensesBetweenParams) ([]TopExpensesBetweenRow, error)

func (*Queries) TotalSpentBetween

func (q *Queries) TotalSpentBetween(ctx context.Context, arg TotalSpentBetweenParams) (int64, error)

func (*Queries) UpdateCategory

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

func (*Queries) UpdateExpense

func (q *Queries) UpdateExpense(ctx context.Context, arg UpdateExpenseParams) error

func (*Queries) UpdateLLMTestResult

func (q *Queries) UpdateLLMTestResult(ctx context.Context, arg UpdateLLMTestResultParams) error

func (*Queries) UpdateLedger

func (q *Queries) UpdateLedger(ctx context.Context, arg UpdateLedgerParams) error

func (*Queries) UpdateOwnerDashboardURL

func (q *Queries) UpdateOwnerDashboardURL(ctx context.Context, arg UpdateOwnerDashboardURLParams) error

func (*Queries) UpdateOwnerPassword

func (q *Queries) UpdateOwnerPassword(ctx context.Context, arg UpdateOwnerPasswordParams) error

func (*Queries) UpdateOwnerPreferences

func (q *Queries) UpdateOwnerPreferences(ctx context.Context, arg UpdateOwnerPreferencesParams) error

func (*Queries) UpdateOwnerProfile

func (q *Queries) UpdateOwnerProfile(ctx context.Context, arg UpdateOwnerProfileParams) error

func (*Queries) UpdateOwnerTrashRetention

func (q *Queries) UpdateOwnerTrashRetention(ctx context.Context, arg UpdateOwnerTrashRetentionParams) error

func (*Queries) UpsertLLMConfig

func (q *Queries) UpsertLLMConfig(ctx context.Context, arg UpsertLLMConfigParams) error

func (*Queries) UpsertTelegramBot

func (q *Queries) UpsertTelegramBot(ctx context.Context, arg UpsertTelegramBotParams) error

Saving a bot token enables polling immediately so the bot can RECEIVE the /start <pairing_code> message that completes the pairing. Without this, the supervisor would never start the bot and pairing could never finish.

func (*Queries) WithTx

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

type RestoreExpenseParams

type RestoreExpenseParams struct {
	UpdatedAt int64
	ID        int64
}

type Session

type Session struct {
	ID        string
	CreatedAt int64
	ExpiresAt int64
	UserAgent sql.NullString
	IpAddress sql.NullString
}

type SetAppStateParams

type SetAppStateParams struct {
	Key   string
	Value string
}

type SetCategoryArchivedParams

type SetCategoryArchivedParams struct {
	IsArchived int64
	ID         int64
}

type SetLLMEnabledParams

type SetLLMEnabledParams struct {
	Enabled   int64
	UpdatedAt int64
}

type SetLedgerArchivedParams

type SetLedgerArchivedParams struct {
	IsArchived int64
	UpdatedAt  int64
	ID         int64
}

type SetTelegramActiveLedgerParams

type SetTelegramActiveLedgerParams struct {
	ActiveLedgerID sql.NullInt64
	UpdatedAt      int64
}

type SetTelegramChatIDParams

type SetTelegramChatIDParams struct {
	ChatID    sql.NullInt64
	UpdatedAt int64
}

type SetTelegramEnabledParams

type SetTelegramEnabledParams struct {
	Enabled   int64
	UpdatedAt int64
}

type SetTelegramLastUpdateIDParams

type SetTelegramLastUpdateIDParams struct {
	LastUpdateID int64
	UpdatedAt    int64
}

type SetTelegramPairingCodeParams

type SetTelegramPairingCodeParams struct {
	PairingCode      sql.NullString
	PairingExpiresAt sql.NullInt64
	UpdatedAt        int64
}

type SoftDeleteExpenseParams

type SoftDeleteExpenseParams struct {
	DeletedAt sql.NullInt64
	UpdatedAt int64
	ID        int64
}

type SpendingByCategoryBetweenParams

type SpendingByCategoryBetweenParams struct {
	SpentAt   int64
	SpentAt_2 int64
}

type SpendingByCategoryBetweenRow

type SpendingByCategoryBetweenRow struct {
	CategoryID    sql.NullInt64
	CategoryName  string
	CategoryColor string
	Total         int64
}

type SpendingByCategoryForLedgerRow

type SpendingByCategoryForLedgerRow struct {
	CategoryID    sql.NullInt64
	CategoryName  string
	CategoryColor string
	Total         int64
}

type SpendingByLedgerBetweenParams

type SpendingByLedgerBetweenParams struct {
	SpentAt   int64
	SpentAt_2 int64
}

type SpendingByLedgerBetweenRow

type SpendingByLedgerBetweenRow struct {
	LedgerID   sql.NullInt64
	LedgerName string
	Total      int64
}

type SummaryBetweenParams

type SummaryBetweenParams struct {
	SpentAt   int64
	SpentAt_2 int64
}

type SummaryBetweenRow

type SummaryBetweenRow struct {
	Total        int64
	ExpenseCount int64
}

type TelegramConfig

type TelegramConfig struct {
	ID                int64
	BotTokenEncrypted string
	BotUsername       string
	ChatID            sql.NullInt64
	PairingCode       sql.NullString
	PairingExpiresAt  sql.NullInt64
	LastUpdateID      int64
	ActiveLedgerID    sql.NullInt64
	Enabled           int64
	CreatedAt         int64
	UpdatedAt         int64
}

type TopExpensesBetweenParams

type TopExpensesBetweenParams struct {
	SpentAt   int64
	SpentAt_2 int64
	Limit     int64
}

type TopExpensesBetweenRow

type TopExpensesBetweenRow struct {
	ID            int64
	Amount        int64
	Description   string
	SpentAt       int64
	CategoryName  sql.NullString
	CategoryColor sql.NullString
	LedgerName    sql.NullString
}

type TotalSpentBetweenParams

type TotalSpentBetweenParams struct {
	SpentAt   int64
	SpentAt_2 int64
}

type UpdateCategoryParams

type UpdateCategoryParams struct {
	Name  string
	Color string
	Icon  sql.NullString
	ID    int64
}

type UpdateExpenseParams

type UpdateExpenseParams struct {
	Amount      int64
	Description string
	Notes       sql.NullString
	SpentAt     int64
	CategoryID  sql.NullInt64
	LedgerID    sql.NullInt64
	UpdatedAt   int64
	ID          int64
}

type UpdateLLMTestResultParams

type UpdateLLMTestResultParams struct {
	LastTestAt      sql.NullInt64
	LastTestSuccess int64
	LastTestError   sql.NullString
	UpdatedAt       int64
}

type UpdateLedgerParams

type UpdateLedgerParams struct {
	Name         string
	Description  sql.NullString
	BudgetAmount sql.NullInt64
	StartDate    sql.NullInt64
	EndDate      sql.NullInt64
	UpdatedAt    int64
	ID           int64
}

type UpdateOwnerDashboardURLParams

type UpdateOwnerDashboardURLParams struct {
	DashboardUrl string
	UpdatedAt    int64
}

type UpdateOwnerPasswordParams

type UpdateOwnerPasswordParams struct {
	PasswordHash string
	UpdatedAt    int64
}

type UpdateOwnerPreferencesParams

type UpdateOwnerPreferencesParams struct {
	CurrencyCode   string
	CurrencySymbol string
	Timezone       string
	UpdatedAt      int64
}

type UpdateOwnerProfileParams

type UpdateOwnerProfileParams struct {
	Email       string
	DisplayName string
	UpdatedAt   int64
}

type UpdateOwnerTrashRetentionParams

type UpdateOwnerTrashRetentionParams struct {
	TrashRetentionDays int64
	UpdatedAt          int64
}

type UpsertLLMConfigParams

type UpsertLLMConfigParams struct {
	Provider        string
	ApiKeyEncrypted sql.NullString
	TextModel       string
	CreatedAt       int64
	UpdatedAt       int64
}

type UpsertTelegramBotParams

type UpsertTelegramBotParams struct {
	BotTokenEncrypted string
	BotUsername       string
	CreatedAt         int64
	UpdatedAt         int64
}

Jump to

Keyboard shortcuts

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