8 lines
212 B
SQL
8 lines
212 B
SQL
-- name: CreateUser :one
|
|
INSERT INTO users (created_at, updated_at, name, api_key)
|
|
VALUES (?, ?, ?, lower(hex(randomblob(256))))
|
|
RETURNING *;
|
|
|
|
-- name: GetUserByAPIKey :one
|
|
SELECT * FROM users WHERE api_key = ?;
|