chore: updated sqlc generated code
This commit is contained in:
parent
40e0b14f2a
commit
9338c65040
1 changed files with 19 additions and 19 deletions
|
|
@ -29,6 +29,25 @@ func (q *Queries) CreateImage(ctx context.Context, arg CreateImageParams) (Image
|
||||||
return i, err
|
return i, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const createNewUser = `-- name: CreateNewUser :one
|
||||||
|
INSERT
|
||||||
|
INTO users (passhash, nickname)
|
||||||
|
VALUES ($1, $2)
|
||||||
|
RETURNING id
|
||||||
|
`
|
||||||
|
|
||||||
|
type CreateNewUserParams struct {
|
||||||
|
Passhash string `json:"passhash"`
|
||||||
|
Nickname string `json:"nickname"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (q *Queries) CreateNewUser(ctx context.Context, arg CreateNewUserParams) (int64, error) {
|
||||||
|
row := q.db.QueryRow(ctx, createNewUser, arg.Passhash, arg.Nickname)
|
||||||
|
var id int64
|
||||||
|
err := row.Scan(&id)
|
||||||
|
return id, err
|
||||||
|
}
|
||||||
|
|
||||||
const deleteUserTitle = `-- name: DeleteUserTitle :one
|
const deleteUserTitle = `-- name: DeleteUserTitle :one
|
||||||
DELETE FROM usertitles
|
DELETE FROM usertitles
|
||||||
WHERE user_id = $1
|
WHERE user_id = $1
|
||||||
|
|
@ -55,25 +74,6 @@ func (q *Queries) DeleteUserTitle(ctx context.Context, arg DeleteUserTitleParams
|
||||||
return i, err
|
return i, err
|
||||||
}
|
}
|
||||||
|
|
||||||
const createNewUser = `-- name: CreateNewUser :one
|
|
||||||
INSERT
|
|
||||||
INTO users (passhash, nickname)
|
|
||||||
VALUES ($1, $2)
|
|
||||||
RETURNING id
|
|
||||||
`
|
|
||||||
|
|
||||||
type CreateNewUserParams struct {
|
|
||||||
Passhash string `json:"passhash"`
|
|
||||||
Nickname string `json:"nickname"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (q *Queries) CreateNewUser(ctx context.Context, arg CreateNewUserParams) (int64, error) {
|
|
||||||
row := q.db.QueryRow(ctx, createNewUser, arg.Passhash, arg.Nickname)
|
|
||||||
var id int64
|
|
||||||
err := row.Scan(&id)
|
|
||||||
return id, err
|
|
||||||
}
|
|
||||||
|
|
||||||
const getImageByID = `-- name: GetImageByID :one
|
const getImageByID = `-- name: GetImageByID :one
|
||||||
SELECT id, storage_type, image_path
|
SELECT id, storage_type, image_path
|
||||||
FROM images
|
FROM images
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue