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

View File

@@ -0,0 +1,48 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.28.0
// source: users.sql
package database
import (
"context"
"time"
"github.com/google/uuid"
)
const createUser = `-- name: CreateUser :one
INSERT INTO users (id, created_at, updated_at, name)
VALUES (
$1,
$2,
$3,
$4
)
RETURNING id, created_at, updated_at, name
`
type CreateUserParams struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
Name string
}
func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) {
row := q.db.QueryRowContext(ctx, createUser,
arg.ID,
arg.CreatedAt,
arg.UpdatedAt,
arg.Name,
)
var i User
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.Name,
)
return i, err
}