-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type override to *time.Time missing time package import #70
Comments
Thanks for reporting. I can provide a fix faster if you're able to provide:
This might have been fixed in #67 relased at https://github.com/jschaf/pggen/releases/tag/2022-07-16 |
I just installed the latest version with go install ... @latest. It just returns this:
Query:
Command:
Table
Generated code:
|
Problem seems to be if type is a pointer. The following command imports
But this does not work:
The same problem is present also with other pointer types. |
I just stumbled on this issue as well. One fix is to run goimports -w <pggen_output_dir>/*.sql.go This will ensure all generated files have all imports, nicely organized. |
Using this flag:
--go-type 'date=*time.Time'
The type is replaced in the struct, but the time package is no longer imported and it will not compile.
The text was updated successfully, but these errors were encountered: