// Code generated by sqlc. DO NOT EDIT. // source: users.sql package postgres import ( "context" "github.com/google/uuid" ) const createUser = `-- name: CreateUser :one INSERT INTO users (email, name, password) VALUES ($1, $2, $3) RETURNING id, email, name, password ` type CreateUserParams struct { Email string Name string Password string } func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) { row := q.db.QueryRowContext(ctx, createUser, arg.Email, arg.Name, arg.Password) var i User err := row.Scan( &i.ID, &i.Email, &i.Name, &i.Password, ) return i, err } const getUser = `-- name: GetUser :one SELECT id, email, name, password FROM users WHERE id = $1 ` func (q *Queries) GetUser(ctx context.Context, id uuid.UUID) (User, error) { row := q.db.QueryRowContext(ctx, getUser, id) var i User err := row.Scan( &i.ID, &i.Email, &i.Name, &i.Password, ) return i, err } const getUserByUsername = `-- name: GetUserByUsername :one SELECT id, email, name, password FROM users WHERE email = $1 ` func (q *Queries) GetUserByUsername(ctx context.Context, email string) (User, error) { row := q.db.QueryRowContext(ctx, getUserByUsername, email) var i User err := row.Scan( &i.ID, &i.Email, &i.Name, &i.Password, ) return i, err }