Version
1.30.0
What happened?
A bug happened!
sql:
-- name: GetUserByEmail :one
SELECT email
FROM users
WHERE email = sqlc.arg(email);
generated:
func (q *Queries) GetUserByEmail(ctx context.Context, email string) (string, error) {
row := q.db.QueryRow(ctx, getUserByEmail, email)
err := row.Scan(&email)
return email, err
}
on ErrNoRows, the function GetUserByEmail returns the input email... expected an empty string.
maybe create a separate string var like what is done with other types? after a little testing, this only happens when the names are the same xD
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
Version
1.30.0
What happened?
A bug happened!
sql:
generated:
on ErrNoRows, the function GetUserByEmail returns the input email... expected an empty string.
maybe create a separate string var like what is done with other types? after a little testing, this only happens when the names are the same xD
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go