// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.31.1 // source: scan_schedule.sql package dbq import ( "context" "github.com/jackc/pgx/v5/pgtype" ) const getScanSchedule = `-- name: GetScanSchedule :one SELECT mode, interval_hours, time_of_day, weekly_day, updated_at FROM scan_schedule WHERE id = true ` type GetScanScheduleRow struct { Mode string IntervalHours *int32 TimeOfDay *string WeeklyDay *int32 UpdatedAt pgtype.Timestamptz } // M7 recurring-scans: returns the singleton schedule row. Used by the // scheduler goroutine on boot and config-refresh, and by the admin GET // handler. func (q *Queries) GetScanSchedule(ctx context.Context) (GetScanScheduleRow, error) { row := q.db.QueryRow(ctx, getScanSchedule) var i GetScanScheduleRow err := row.Scan( &i.Mode, &i.IntervalHours, &i.TimeOfDay, &i.WeeklyDay, &i.UpdatedAt, ) return i, err } const updateScanSchedule = `-- name: UpdateScanSchedule :exec UPDATE scan_schedule SET mode = $1, interval_hours = $2, time_of_day = $3, weekly_day = $4, updated_at = now() WHERE id = true ` type UpdateScanScheduleParams struct { Mode string IntervalHours *int32 TimeOfDay *string WeeklyDay *int32 } // Admin PATCH replaces the whole row; CHECK constraints enforce validity. // The application normalizes mode='off' to NULL the per-mode fields // before calling this. func (q *Queries) UpdateScanSchedule(ctx context.Context, arg UpdateScanScheduleParams) error { _, err := q.db.Exec(ctx, updateScanSchedule, arg.Mode, arg.IntervalHours, arg.TimeOfDay, arg.WeeklyDay, ) return err }