aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/db/query.sql.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-17 18:59:55 +0900
committernsfisis <nsfisis@gmail.com>2024-08-17 18:59:55 +0900
commitf926ef682de637b717d3b0cc0eaee43c59e83c95 (patch)
treea6cc6852ecdfe5643d336b77e9956fe6383d53ef /backend/db/query.sql.go
parent29721ab9971c401d5fb5d2a2cfd730b156a8e195 (diff)
downloadphperkaigi-2025-albatross-f926ef682de637b717d3b0cc0eaee43c59e83c95.tar.gz
phperkaigi-2025-albatross-f926ef682de637b717d3b0cc0eaee43c59e83c95.tar.zst
phperkaigi-2025-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.go13
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