Add sqlc configuration and core queries
sqlc.yaml (sqlite, schema migrations/, queries migrations/queries/) generates internal/db with emit_interface. Queries cover dinners (create, get, list by status, update, archive, set favorite), recipes with ingredients and steps (upsert by source_url, get, replace children), photos (insert, get by sha256) and get/upsert for the five settings singletons. Repository tests run every query against a migrated temp database. make sqlc regenerates with the pinned sqlc v1.31.1 (dev tool only, not in go.mod); make sqlc-check regenerates and fails on any drift in internal/db, and CI runs it after make test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,309 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.31.1
|
||||
|
||||
package db
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
type AiRun struct {
|
||||
ID string
|
||||
Skill string
|
||||
SkillVersion string
|
||||
Provider string
|
||||
Model string
|
||||
Temperature float64
|
||||
Status string
|
||||
LatencyMs sql.NullInt64
|
||||
TokensIn sql.NullInt64
|
||||
TokensOut sql.NullInt64
|
||||
Error sql.NullString
|
||||
RequestRedacted string
|
||||
ResponseRedacted sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type AiSetting struct {
|
||||
ID int64
|
||||
Provider string
|
||||
BaseUrl string
|
||||
Model string
|
||||
Temperature float64
|
||||
SystemPrompt sql.NullString
|
||||
ApiKeyCt []byte
|
||||
ApiKeyLast4 sql.NullString
|
||||
KeyVerifiedAt sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type ChatSetting struct {
|
||||
ID int64
|
||||
WebhookUrlCt []byte
|
||||
SpaceLabel sql.NullString
|
||||
LastTestAt sql.NullString
|
||||
LastTestStatus sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type Dinner struct {
|
||||
ID string
|
||||
Name string
|
||||
NormalizedName string
|
||||
Status string
|
||||
Origin string
|
||||
Method sql.NullString
|
||||
MinutesTotal sql.NullInt64
|
||||
Difficulty sql.NullString
|
||||
Cuisine sql.NullString
|
||||
IsFavorite int64
|
||||
RecipeID sql.NullString
|
||||
PhotoID sql.NullString
|
||||
GroundingStatus string
|
||||
UpdatedBy sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type HouseholdSetting struct {
|
||||
ID int64
|
||||
Timezone string
|
||||
DinnerTime string
|
||||
ReminderTime string
|
||||
ReviewTime string
|
||||
PlanDraftDow int64
|
||||
PlanDraftTime string
|
||||
SuggestionsDow int64
|
||||
SuggestionsTime string
|
||||
ChatAutosendDow int64
|
||||
ChatAutosendTime string
|
||||
OnboardingCompletedAt sql.NullString
|
||||
UpdatesSeenAt sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type IntegrationsGoogle struct {
|
||||
ID int64
|
||||
RefreshTokenCt []byte
|
||||
CalendarID sql.NullString
|
||||
CalendarName sql.NullString
|
||||
ConnectedAt string
|
||||
LastSyncError sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type Job struct {
|
||||
ID string
|
||||
Kind string
|
||||
Status string
|
||||
Payload string
|
||||
Result sql.NullString
|
||||
Error sql.NullString
|
||||
StartedAt sql.NullString
|
||||
FinishedAt sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type NotificationOutbox struct {
|
||||
ID string
|
||||
EventKey string
|
||||
Channel string
|
||||
Payload string
|
||||
Status string
|
||||
Attempts int64
|
||||
NextAttemptAt sql.NullString
|
||||
LastError sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type NotificationPref struct {
|
||||
Event string
|
||||
Push int64
|
||||
Chat int64
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type Photo struct {
|
||||
ID string
|
||||
SourceUrl string
|
||||
LocalPath string
|
||||
Width int64
|
||||
Height int64
|
||||
Sha256 string
|
||||
FetchedAt string
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type PlanDay struct {
|
||||
ID string
|
||||
PlanID string
|
||||
Date string
|
||||
DinnerID sql.NullString
|
||||
IsNew int64
|
||||
CalendarEventID sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type PushSubscription struct {
|
||||
ID string
|
||||
Endpoint string
|
||||
P256dh string
|
||||
Auth string
|
||||
UserAgent sql.NullString
|
||||
FailureCount int64
|
||||
LastSuccessAt sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type Recipe struct {
|
||||
ID string
|
||||
SourceUrl string
|
||||
SiteName sql.NullString
|
||||
Title string
|
||||
TotalMinutes sql.NullInt64
|
||||
PrepMinutes sql.NullInt64
|
||||
CookMinutes sql.NullInt64
|
||||
Yield sql.NullString
|
||||
RawJsonld string
|
||||
FetchedAt string
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type RecipeIngredient struct {
|
||||
ID string
|
||||
RecipeID string
|
||||
Position int64
|
||||
RawText string
|
||||
Name sql.NullString
|
||||
Qty sql.NullString
|
||||
Unit sql.NullString
|
||||
Note sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type RecipeSearchSetting struct {
|
||||
ID int64
|
||||
Provider string
|
||||
BaseUrl sql.NullString
|
||||
ApiKeyCt []byte
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type RecipeStep struct {
|
||||
ID string
|
||||
RecipeID string
|
||||
Position int64
|
||||
Text string
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type RotationReview struct {
|
||||
ID string
|
||||
DinnerID string
|
||||
PlanDate string
|
||||
Status string
|
||||
Decision sql.NullString
|
||||
DecidedAt sql.NullString
|
||||
UpdatedBy sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type ScheduleRun struct {
|
||||
ID string
|
||||
Schedule string
|
||||
PeriodKey string
|
||||
CreatedAt string
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
IDHash string
|
||||
Subject string
|
||||
Email string
|
||||
Name string
|
||||
Groups string
|
||||
CsrfToken string
|
||||
CreatedAt string
|
||||
LastSeenAt string
|
||||
ExpiresAt string
|
||||
}
|
||||
|
||||
type ShoppingGroup struct {
|
||||
ID string
|
||||
ListID string
|
||||
DinnerID string
|
||||
Position int64
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type ShoppingItem struct {
|
||||
ID string
|
||||
GroupID string
|
||||
Name string
|
||||
Qty sql.NullString
|
||||
Needed int64
|
||||
Position int64
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type ShoppingList struct {
|
||||
ID string
|
||||
WeekStart string
|
||||
PlanID string
|
||||
Title string
|
||||
Status string
|
||||
SentToChatAt sql.NullString
|
||||
FrozenAt sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type Suggestion struct {
|
||||
ID string
|
||||
DinnerID string
|
||||
BatchID string
|
||||
Reason string
|
||||
CitedRegularIds string
|
||||
Status string
|
||||
DecidedAt sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type SuggestionBatch struct {
|
||||
ID string
|
||||
Trigger string
|
||||
Status string
|
||||
AiRunID sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
type WeekPlan struct {
|
||||
ID string
|
||||
WeekStart string
|
||||
Status string
|
||||
AiNote sql.NullString
|
||||
AiRunID sql.NullString
|
||||
CalendarSyncedAt sql.NullString
|
||||
CreatedAt string
|
||||
UpdatedAt string
|
||||
}
|
||||
Reference in New Issue
Block a user