-
Notifications
You must be signed in to change notification settings - Fork 1k
Code created with duplicated fields #2429
Copy link
Copy link
Open
Labels
Milestone
Description
Version
Other
What happened?
Hi guys!
It generates an invalid go struct when there are duplicated fields at schema. Go compiler generates a redeclared field error.
type Tournament struct {
ID string
Status sql.NullString
Status sql.NullString
}Using sqlc version 1.19.0
Relevant log output
No response
Database schema
CREATE TABLE tournaments (
id VARCHAR(255) NOT NULL,
status VARCHAR(255),
status VARCHAR(255)
);SQL queries
-- name: FindTournamentByID :one
SELECT *
FROM tournaments
WHERE id = ?;Configuration
{
"version": "1",
"packages": [
{
"path": "sqlite",
"name": "sqlite",
"schema": "query.sql",
"queries": "query.sql",
"engine": "sqlite",
"emit_json_tags": false,
"emit_prepared_queries": true,
"emit_interface": true
}
]
}Playground URL
https://play.sqlc.dev/p/9dadfd2d3b03f88c36209c864a83167e464cb327d8cb5a31aea62242b5b5fb58
What operating system are you using?
Windows
What database engines are you using?
SQLite
What type of code are you generating?
Go
Reactions are currently unavailable