From c00b690bd6f600554a1404e692bd9e4373325d27 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Fri, 17 Jan 2025 13:21:24 +0000
Subject: Initial commit

---
 pkg/database/query/users.sql | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 pkg/database/query/users.sql

(limited to 'pkg/database/query/users.sql')

diff --git a/pkg/database/query/users.sql b/pkg/database/query/users.sql
new file mode 100644
index 0000000..c70ebbb
--- /dev/null
+++ b/pkg/database/query/users.sql
@@ -0,0 +1,23 @@
+-- name: GetUserByID :one
+SELECT * FROM users
+WHERE id = $1 LIMIT 1;
+
+-- name: GetUserByName :one
+SELECT * FROM users
+WHERE username = $1 LIMIT 1;
+
+-- name: ListUsers :many
+SELECT * FROM users
+ORDER BY username;
+
+-- name: CreateUser :one
+INSERT INTO users (
+  username, password
+) VALUES (
+  $1, $2
+)
+RETURNING *;
+
+-- name: DeleteUser :exec
+DELETE FROM users
+WHERE id = $1;
-- 
cgit v1.2.3-70-g09d2

