import () in "Code generated by sqlc" #1402
Replies: 3 comments
-
try to use https://github.com/tkcrm/pgxgen pgxgen sqlc generate |
Beta Was this translation helpful? Give feedback.
-
sqlc should determine the imports for you, but there might be a bug. Can you show a more concrete example on https://play.sqlc.dev/? |
Beta Was this translation helpful? Give feedback.
-
I am able to duplicate this behavior by providing a RETURNING clause on a query marked It's pretty nonsensical to have a RETURNING clause there, but it would be nice to get a warning from sqlc instead of an un-compilable file. |
Beta Was this translation helpful? Give feedback.
-
It is not clear how "import" is generated in sqlc.
E.g.
import (
"context"
"encoding/json"
"time"
)
I have a query that is using a column which is 'timestamp' postgres type.
Sqlc generate makes the proper struct with 'time.Time' type.
E.g.
StartedAt *time.Time
However, in the import "time" is missing :
import (
"context"
"encoding/json"
)
Not sure what to do to make it inserted there?
Beta Was this translation helpful? Give feedback.
All reactions