// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial // SPDX-FileCopyrightText: 2025-2026 Christian Galo // Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.29.0 // source: instance_settings.sql package instance import ( "context" "database/sql" "encoding/json" ) const getInstanceSetting = `-- name: GetInstanceSetting :one SELECT key, value, updated_at, updated_by FROM core.instance_settings WHERE key = $1 ` func (q *Queries) GetInstanceSetting(ctx context.Context, key string) (CoreInstanceSetting, error) { row := q.db.QueryRowContext(ctx, getInstanceSetting, key) var i CoreInstanceSetting err := row.Scan( &i.Key, &i.Value, &i.UpdatedAt, &i.UpdatedBy, ) return i, err } const upsertInstanceSetting = `-- name: UpsertInstanceSetting :exec INSERT INTO core.instance_settings (key, value, updated_by) VALUES ($1, $2, $3) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_by = EXCLUDED.updated_by, updated_at = NOW() ` type UpsertInstanceSettingParams struct { Key string `json:"key"` Value json.RawMessage `json:"value"` UpdatedBy sql.NullString `json:"updated_by"` } func (q *Queries) UpsertInstanceSetting(ctx context.Context, arg UpsertInstanceSettingParams) error { _, err := q.db.ExecContext(ctx, upsertInstanceSetting, arg.Key, arg.Value, arg.UpdatedBy) return err }