DATABASE!

This commit is contained in:
2025-03-11 18:13:22 +02:00
parent 5141fa8047
commit 7eb464272e
10 changed files with 134 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.28.0
// source: CreateUser.sql
package database
import (
"context"
)
const createUser = `-- name: CreateUser :one
INSERT INTO users (id, created_at, updated_at, email)
VALUES (gen_random_uuid(), NOW(), NOW(), $1)
RETURNING id, created_at, updated_at, email
`
func (q *Queries) CreateUser(ctx context.Context, email string) (User, error) {
row := q.db.QueryRowContext(ctx, createUser, email)
var i User
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.Email,
)
return i, err
}