Update self profile

This commit is contained in:
2025-03-11 22:57:39 +02:00
parent 1bad21ae45
commit 704393e0e4
3 changed files with 108 additions and 0 deletions

View 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
}