You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When no database is set in sqlc.json, this generates valid code that works:
INSERT INTO t (location) VALUES (ST_GeomFromEWKB(@location));
This produces the following output, using my override:
type T struct {
Location postgis.PointS `db:"location" json:"location"`
}
However as soon as a database is set in sqlc.json, that same code results in:
cannot use postgis.PointS{…} (value of type postgis.PointS) as []byte value in struct literal
This is because the generated struct now has Location interface{}, ignoring my override.
I'd like to be able to use sqlc vet against my actual database but I wouldn't expect it to change the output of the generated code if my migrations produce that exact same database reliably.
Relevant log output
No response
Database schema
Column | Type | Collation | Nullable | Default
-----------------+----------------------+-----------+----------+------------------------------
location | geometry(Point,4326) | | not null |
SQL queries
INSERT INTO my_table (location) VALUES (ST_GeomFromEWKB(@location));
Version
1.27.0
What happened?
When no database is set in
sqlc.json
, this generates valid code that works:This produces the following output, using my override:
However as soon as a database is set in
sqlc.json
, that same code results in:This is because the generated struct now has
Location interface{}
, ignoring my override.I'd like to be able to use
sqlc vet
against my actual database but I wouldn't expect it to change the output of the generated code if my migrations produce that exact same database reliably.Relevant log output
No response
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
Linux
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: