feat: next
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.28.0
|
||||
// sqlc v1.29.0
|
||||
// source: user.sql
|
||||
|
||||
package sqlc
|
||||
@ -24,7 +24,8 @@ SELECT
|
||||
id,
|
||||
username,
|
||||
password,
|
||||
profile_picture_id
|
||||
profile_picture_id,
|
||||
webauthn_id
|
||||
FROM user
|
||||
WHERE
|
||||
id = ?1
|
||||
@ -39,6 +40,7 @@ func (q *Queries) GetUser(ctx context.Context, id int64) (User, error) {
|
||||
&i.Username,
|
||||
&i.Password,
|
||||
&i.ProfilePictureID,
|
||||
&i.WebauthnID,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
@ -48,7 +50,8 @@ SELECT
|
||||
id,
|
||||
username,
|
||||
password,
|
||||
profile_picture_id
|
||||
profile_picture_id,
|
||||
webauthn_id
|
||||
FROM user
|
||||
WHERE
|
||||
username = ?1
|
||||
@ -63,6 +66,7 @@ func (q *Queries) GetUserbyUsername(ctx context.Context, username string) (User,
|
||||
&i.Username,
|
||||
&i.Password,
|
||||
&i.ProfilePictureID,
|
||||
&i.WebauthnID,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
@ -70,21 +74,24 @@ func (q *Queries) GetUserbyUsername(ctx context.Context, username string) (User,
|
||||
const insertUser = `-- name: InsertUser :one
|
||||
INSERT INTO user (
|
||||
username,
|
||||
password
|
||||
password,
|
||||
webauthn_id
|
||||
) VALUES (
|
||||
?1,
|
||||
?2
|
||||
?2,
|
||||
?3
|
||||
)
|
||||
RETURNING id
|
||||
`
|
||||
|
||||
type InsertUserParams struct {
|
||||
Username string
|
||||
Password string
|
||||
Username string
|
||||
Password string
|
||||
WebauthnID string
|
||||
}
|
||||
|
||||
func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (int64, error) {
|
||||
row := q.db.QueryRowContext(ctx, insertUser, arg.Username, arg.Password)
|
||||
row := q.db.QueryRowContext(ctx, insertUser, arg.Username, arg.Password, arg.WebauthnID)
|
||||
var id int64
|
||||
err := row.Scan(&id)
|
||||
return id, err
|
||||
|
Reference in New Issue
Block a user