Files
aperture/aperturedb/sqlc/onion.sql.go
Jordi Montes c0353f07dd sqlc: bump version to v1.25.0
Since v0.18.0 there they multiple bug fixes, support more postgres/sqlite
features, etc...

Nothing impacting the current code.

NOTE: It also looks like sqlc is growing as a company and wants to support
more languages, add feature for cloud clients, etc... Because of the
open source nature of this project I do not think that brings any extra
benefit. The only remarkable thing is that they are working on doing the
code more modular, and extracting the code generation in multiple "plugins"
They already extracted the go one. No changes are needed by now, but maybe
at some point they delete the code gen form the main project and the config
files need to be updated to use the plugin system [sqlc-dev/plugin-sdk-go].
2024-02-13 11:28:53 -08:00

54 lines
1.1 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
// source: onion.sql
package sqlc
import (
"context"
"time"
)
const deleteOnionPrivateKey = `-- name: DeleteOnionPrivateKey :exec
DELETE FROM onion
`
func (q *Queries) DeleteOnionPrivateKey(ctx context.Context) error {
_, err := q.db.ExecContext(ctx, deleteOnionPrivateKey)
return err
}
const selectOnionPrivateKey = `-- name: SelectOnionPrivateKey :one
SELECT private_key
FROM onion
LIMIT 1
`
func (q *Queries) SelectOnionPrivateKey(ctx context.Context) ([]byte, error) {
row := q.db.QueryRowContext(ctx, selectOnionPrivateKey)
var private_key []byte
err := row.Scan(&private_key)
return private_key, err
}
const upsertOnion = `-- name: UpsertOnion :exec
INSERT INTO onion (
private_key, created_at
) VALUES (
$1, $2
) ON CONFLICT (
private_key
) DO NOTHING
`
type UpsertOnionParams struct {
PrivateKey []byte
CreatedAt time.Time
}
func (q *Queries) UpsertOnion(ctx context.Context, arg UpsertOnionParams) error {
_, err := q.db.ExecContext(ctx, upsertOnion, arg.PrivateKey, arg.CreatedAt)
return err
}