// Code generated by sqlc. DO NOT EDIT. // source: user.sql package database import ( "context" "time" ) const createUser = `-- name: CreateUser :one INSERT INTO "user" ( "is_admin", "password", "created_at" ) VALUES ( $1, $2, $3 ) RETURNING id, is_admin, password, created_at ` type CreateUserParams struct { IsAdmin bool `json:"is_admin"` Password []byte `json:"password"` CreatedAt time.Time `json:"created_at"` } func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) { row := q.db.QueryRowContext(ctx, createUser, arg.IsAdmin, arg.Password, arg.CreatedAt) var i User err := row.Scan( &i.ID, &i.IsAdmin, &i.Password, &i.CreatedAt, ) return i, err } const getUserByID = `-- name: GetUserByID :one SELECT "id", "is_admin", "password", "created_at" FROM "user" WHERE "id" = $1 ` func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error) { row := q.db.QueryRowContext(ctx, getUserByID, id) var i User err := row.Scan( &i.ID, &i.IsAdmin, &i.Password, &i.CreatedAt, ) return i, err } const updateUser = `-- name: UpdateUser :exec UPDATE "user" SET ( "is_admin", "password", "created_at" ) = ( $1, $2, $3 ) WHERE "id" = $4 ` type UpdateUserParams struct { IsAdmin bool `json:"is_admin"` Password []byte `json:"password"` CreatedAt time.Time `json:"created_at"` ID int64 `json:"id"` } func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error { _, err := q.db.ExecContext(ctx, updateUser, arg.IsAdmin, arg.Password, arg.CreatedAt, arg.ID, ) return err }