We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.12.0
In the generated function, there is a Go error. id redeclared in this block
id redeclared in this block
There are two id variables. One in the function parameter and another in the function body.
const getUserRole = `-- name: GetUserRole :one SELECT id FROM public.user_roles WHERE id = $1 LIMIT 1 ` func (q *Queries) GetUserRole(ctx context.Context, id int64) (int64, error) { row := q.db.QueryRow(ctx, getUserRole, id) var id int64 err := row.Scan(&id) return id, err }
CREATE TABLE user_roles ( id BIGSERIAL PRIMARY KEY );
-- name: GetUserRole :one SELECT * FROM public.user_roles WHERE id = $1 LIMIT 1;
version: "2" sql: - schema: "server/database/postgres/migrate/" queries: "server/database/postgres/sqlc_queries/user/" engine: "postgresql" gen: go: package: "user" out: "server/go/layer/repository/db/pgsql/user" sql_package: "pgx/v4"
No response
Windows
PostgreSQL
Go
The text was updated successfully, but these errors were encountered:
Seems to fixed by #1298
Sorry, something went wrong.
Duplicate of #1490
No branches or pull requests
Version
1.12.0
What happened?
In the generated function, there is a Go error.
id redeclared in this block
There are two id variables. One in the function parameter and another in the function body.
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
The text was updated successfully, but these errors were encountered: