feat: got sqlc to work

This commit is contained in:
2025-06-15 01:12:22 +03:00
parent db8b7c0372
commit 8aeb6e19d4
9 changed files with 130 additions and 3 deletions

View File

@@ -1,2 +1,2 @@
-- name: CreateUser :one
INSERT INTO user (username, verified, banned, registration_date) VALUES ($1, false, false, NOW()) RETURNING id, username, verified, banned, registration_date;
INSERT INTO users(username, verified, banned, registration_date) VALUES ($1, false, false, NOW()) RETURNING id, username, verified, banned, registration_date;

View File

@@ -2,7 +2,8 @@
CREATE TABLE IF NOT EXISTS "users" (
id BIGSERIAL PRIMARY KEY,
username VARCHAR(20) UNIQUE NOT NULL,
banned BOOLEAN NOT NULL,
verified BOOLEAN,
banned BOOLEAN,
registration_date TIMESTAMP NOT NULL
);

View File

@@ -1,6 +1,6 @@
version: "2"
sql:
- schema: "../postgresql/schema.sql"
- schema: "schema.sql"
queries: "query.sql"
engine: "postgresql"
gen: