This commit is contained in:
2025-03-11 10:53:45 +02:00
parent f23f3fbf53
commit 9bbda8d021
14 changed files with 231 additions and 3 deletions

2
sql/queries/getUser.sql Normal file
View File

@@ -0,0 +1,2 @@
-- name: GetUser :one
SELECT * FROM users WHERE name = $1;

9
sql/queries/users.sql Normal file
View File

@@ -0,0 +1,9 @@
-- name: CreateUser :one
INSERT INTO users (id, created_at, updated_at, name)
VALUES (
$1,
$2,
$3,
$4
)
RETURNING *;

10
sql/schema/0001_users.sql Normal file
View File

@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE users(
id UUID PRIMARY KEY,
created_at TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP not null,
name VARCHAR(64) not null UNIQUE
);
-- +goose Down
DROP TABLE users;