Update self profile
This commit is contained in:
36
internal/database/UpdateUserEmailAndPassword.sql.go
Normal file
36
internal/database/UpdateUserEmailAndPassword.sql.go
Normal file
@@ -0,0 +1,36 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.28.0
|
||||
// source: UpdateUserEmailAndPassword.sql
|
||||
|
||||
package database
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
const updateUserEmailAndPassword = `-- name: UpdateUserEmailAndPassword :one
|
||||
UPDATE users SET email = $1, hashed_password = $2, updated_at = CURRENT_TIMESTAMP WHERE id = $3
|
||||
RETURNING id, created_at, updated_at, email, hashed_password
|
||||
`
|
||||
|
||||
type UpdateUserEmailAndPasswordParams struct {
|
||||
Email string
|
||||
HashedPassword string
|
||||
ID uuid.UUID
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateUserEmailAndPassword(ctx context.Context, arg UpdateUserEmailAndPasswordParams) (User, error) {
|
||||
row := q.db.QueryRowContext(ctx, updateUserEmailAndPassword, arg.Email, arg.HashedPassword, arg.ID)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.Email,
|
||||
&i.HashedPassword,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
Reference in New Issue
Block a user