| 123456789101112131415161718192021222324252627282930313233343536 |
- // Code generated by sqlc. DO NOT EDIT.
- // versions:
- // sqlc v1.30.0
- // source: settings.sql
- package queries
- import (
- "context"
- )
- const getSetting = `-- name: GetSetting :one
- SELECT value FROM settings WHERE key = ?
- `
- func (q *Queries) GetSetting(ctx context.Context, key string) (string, error) {
- row := q.db.QueryRowContext(ctx, getSetting, key)
- var value string
- err := row.Scan(&value)
- return value, err
- }
- const upsertSetting = `-- name: UpsertSetting :exec
- INSERT INTO settings (key, value) VALUES (?, ?)
- ON CONFLICT(key) DO UPDATE SET value = excluded.value
- `
- type UpsertSettingParams struct {
- Key string `json:"key"`
- Value string `json:"value"`
- }
- func (q *Queries) UpsertSetting(ctx context.Context, arg UpsertSettingParams) error {
- _, err := q.db.ExecContext(ctx, upsertSetting, arg.Key, arg.Value)
- return err
- }
|