1
0
go-rss-aggregator/sql/queries/users.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 = ?;