feat: got sqlc to work
This commit is contained in:
27
backend/internal/database/query.sql.go
Normal file
27
backend/internal/database/query.sql.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.29.0
|
||||
// source: query.sql
|
||||
|
||||
package database
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
const createUser = `-- name: CreateUser :one
|
||||
INSERT INTO users(username, verified, banned, registration_date) VALUES ($1, false, false, NOW()) RETURNING id, username, verified, banned, registration_date
|
||||
`
|
||||
|
||||
func (q *Queries) CreateUser(ctx context.Context, username string) (User, error) {
|
||||
row := q.db.QueryRow(ctx, createUser, username)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.Username,
|
||||
&i.Verified,
|
||||
&i.Banned,
|
||||
&i.RegistrationDate,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
Reference in New Issue
Block a user