// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.27.0
// source: access.sql

package querier

import (
	"context"
)

const createKeyPair = `-- name: CreateKeyPair :one
INSERT INTO anclax.access_key_pairs (access_key, secret_key)
VALUES ($1, $2)
RETURNING access_key, secret_key, created_at, updated_at
`

type CreateKeyPairParams struct {
	AccessKey string
	SecretKey string
}

func (q *Queries) CreateKeyPair(ctx context.Context, arg CreateKeyPairParams) (*AnclaxAccessKeyPair, error) {
	row := q.db.QueryRow(ctx, createKeyPair, arg.AccessKey, arg.SecretKey)
	var i AnclaxAccessKeyPair
	err := row.Scan(
		&i.AccessKey,
		&i.SecretKey,
		&i.CreatedAt,
		&i.UpdatedAt,
	)
	return &i, err
}

const deleteKeyPair = `-- name: DeleteKeyPair :exec
DELETE FROM anclax.access_key_pairs
WHERE access_key = $1
`

func (q *Queries) DeleteKeyPair(ctx context.Context, accessKey string) error {
	_, err := q.db.Exec(ctx, deleteKeyPair, accessKey)
	return err
}

const getKeyPair = `-- name: GetKeyPair :one
SELECT access_key, secret_key, created_at, updated_at FROM anclax.access_key_pairs
WHERE access_key = $1
`

func (q *Queries) GetKeyPair(ctx context.Context, accessKey string) (*AnclaxAccessKeyPair, error) {
	row := q.db.QueryRow(ctx, getKeyPair, accessKey)
	var i AnclaxAccessKeyPair
	err := row.Scan(
		&i.AccessKey,
		&i.SecretKey,
		&i.CreatedAt,
		&i.UpdatedAt,
	)
	return &i, err
}
