diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-17 18:59:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-17 18:59:55 +0900 |
| commit | f926ef682de637b717d3b0cc0eaee43c59e83c95 (patch) | |
| tree | a6cc6852ecdfe5643d336b77e9956fe6383d53ef /backend/db/query.sql.go | |
| parent | 29721ab9971c401d5fb5d2a2cfd730b156a8e195 (diff) | |
| download | iosdc-japan-2024-albatross-f926ef682de637b717d3b0cc0eaee43c59e83c95.tar.gz iosdc-japan-2024-albatross-f926ef682de637b717d3b0cc0eaee43c59e83c95.tar.zst iosdc-japan-2024-albatross-f926ef682de637b717d3b0cc0eaee43c59e83c95.zip | |
feat(backend): allow login/signup with email address
Diffstat (limited to 'backend/db/query.sql.go')
| -rw-r--r-- | backend/db/query.sql.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go index 34b0ae9..02e660a 100644 --- a/backend/db/query.sql.go +++ b/backend/db/query.sql.go @@ -245,6 +245,19 @@ func (q *Queries) GetUserByID(ctx context.Context, userID int32) (User, error) { return i, err } +const getUserIDByUsername = `-- name: GetUserIDByUsername :one +SELECT user_id FROM users +WHERE users.username = $1 +LIMIT 1 +` + +func (q *Queries) GetUserIDByUsername(ctx context.Context, username string) (int32, error) { + row := q.db.QueryRow(ctx, getUserIDByUsername, username) + var user_id int32 + err := row.Scan(&user_id) + return user_id, err +} + const isRegistrationTokenValid = `-- name: IsRegistrationTokenValid :one SELECT EXISTS ( SELECT 1 FROM registration_tokens |
