36 lines
729 B
Go
36 lines
729 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.23.0
|
|
// source: config.sql
|
|
|
|
package db
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const getConfig = `-- name: GetConfig :one
|
|
SELECT ticket_key, ticket_id
|
|
FROM appconfig
|
|
`
|
|
|
|
func (q *Queries) GetConfig(ctx context.Context) (Appconfig, error) {
|
|
row := q.db.QueryRow(ctx, getConfig)
|
|
var i Appconfig
|
|
err := row.Scan(&i.TicketKey, &i.TicketID)
|
|
return i, err
|
|
}
|
|
|
|
const setNewConfig = `-- name: SetNewConfig :one
|
|
UPDATE appconfig
|
|
SET ticket_id = ticket_id + 1
|
|
RETURNING ticket_key, ticket_id
|
|
`
|
|
|
|
func (q *Queries) SetNewConfig(ctx context.Context) (Appconfig, error) {
|
|
row := q.db.QueryRow(ctx, setNewConfig)
|
|
var i Appconfig
|
|
err := row.Scan(&i.TicketKey, &i.TicketID)
|
|
return i, err
|
|
}
|