-
Notifications
You must be signed in to change notification settings - Fork 902
Closed
Labels
bugSomething isn't workingSomething isn't workingtriageNew issues that hasn't been reviewedNew issues that hasn't been reviewed
Description
Version
1.10.0
What happened?
A bug happened! Of course, I am more than happy to help with this issue. That said, it was my first time using and I guess I broke it. Also of course not urgent as easily avoidable but would be nice for someone trying out on first time and in theory seems doable but I wouldn't want to make any assumption about a shiny tool I just love to use.
Slightly an edge case but sqlc
reports uncompilable code.
const getUser = `-- name: GetUser :one
SELECT sub FROM users
WHERE sub = $1 LIMIT 1
func (q *Queries) GetUser(ctx context.Context, sub uuid.UUID) (uuid.UUID, error) {
row := q.db.QueryRowContext(ctx, getUser, sub)
var sub uuid.UUID
err := row.Scan(&sub)
return sub, err
}
`
### Relevant log output
```shell
sub redeclared in block
### Database schema
```sql
CREATE TABLE users (
sub UUID PRIMARY KEY
)
SQL queries
SELECT sub
FROM users
WHERE sub = $1
LIMIT 1
Configuration
version: 1
packages:
- path: "pkg/test"
name: "test"
engine: "postgresql"
schema: "pkg/server/postgres/migrations"
queries: "pkg/test/queries.sql"
emit_interface: true
Playground URL
https://play.sqlc.dev/p/96f9cc7ae6630ae490cbaee0429188c3bd46e564765268f626a0fed918c397c9
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageNew issues that hasn't been reviewedNew issues that hasn't been reviewed