Skip to content

Commit efa17da

Browse files
style: normalize SQL field names to use double quotes for consistency
1 parent 3dd5234 commit efa17da

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

internal/repositories/user/create.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ type CreateOutput struct {
2626
const createQuery = `
2727
INSERT INTO
2828
users (
29-
id,
30-
NAME,
31-
email,
32-
password_hash,
33-
code_to_invite,
34-
confirmed_email_at,
35-
login_blocked_until,
36-
birth_date
29+
"id",
30+
"name",
31+
"email",
32+
"password_hash",
33+
"code_to_invite",
34+
"confirmed_email_at",
35+
"login_blocked_until",
36+
"birth_date"
3737
)
3838
VALUES
3939
($1, $2, $3, $4, $5, $6, $7, $8);

internal/repositories/user/get_by_email.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ type GetByEmailOutput struct {
1515

1616
const getByEmailQuery = `
1717
SELECT
18-
id,
19-
email,
20-
password_hash,
21-
login_blocked_until
18+
"id",
19+
"email",
20+
"password_hash",
21+
"login_blocked_until"
2222
FROM
23-
users
23+
"users"
2424
WHERE
25-
LOWER(email) = LOWER($1)
25+
LOWER("email") = LOWER($1)
2626
LIMIT
27-
1
27+
1;
2828
`
2929

3030
func (r *Repository) GetByEmail(email string) (*GetByEmailOutput, error) {

0 commit comments

Comments
 (0)