lockserver/db/users.sql.go
Finn 350fc3b339
All checks were successful
/ build-container (push) Successful in 1m3s
rip out all auth stuff, add a containerfile
2024-04-23 17:34:57 -07:00

41 lines
926 B
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.20.0
// source: users.sql
package db
import (
"context"
)
const createUser = `-- name: CreateUser :exec
INSERT INTO users (name) VALUES (?)
`
func (q *Queries) CreateUser(ctx context.Context, name string) error {
_, err := q.db.ExecContext(ctx, createUser, name)
return err
}
const getUserByID = `-- name: GetUserByID :one
SELECT id, name FROM users WHERE id = ?
`
func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error) {
row := q.db.QueryRowContext(ctx, getUserByID, id)
var i User
err := row.Scan(&i.ID, &i.Name)
return i, err
}
const getUserByName = `-- name: GetUserByName :one
SELECT id, name FROM users WHERE name = ?
`
func (q *Queries) GetUserByName(ctx context.Context, name string) (User, error) {
row := q.db.QueryRowContext(ctx, getUserByName, name)
var i User
err := row.Scan(&i.ID, &i.Name)
return i, err
}