Open leobrines opened 1 year ago
Other
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
No response
CREATE TABLE tournaments ( id VARCHAR(255) NOT NULL, status VARCHAR(255), status VARCHAR(255) );
-- name: FindTournamentByID :one SELECT * FROM tournaments WHERE id = ?;
{ "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 } ] }
https://play.sqlc.dev/p/9dadfd2d3b03f88c36209c864a83167e464cb327d8cb5a31aea62242b5b5fb58
Windows
SQLite
Go
I don't think SQLite allows duplicate columns to be defined in CREATE TABLE, what behavior do you expect?
It is expected it does not generate code that cannot compile
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.
Using sqlc version 1.19.0
Relevant log output
No response
Database schema
SQL queries
Configuration
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