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
I need to generate my go structs in a different package. The package name is repo.
Currently the generator will always generate with package name model, enum or table.
Solution (preferred):
I'd like another parameter to be added that allows me to define the go package name for the generated files. (Or multiple parameters for each package)
I'm not sure I understand why that particular behavior matters, then again, I don't think there's anything preventing that feature.
That being said....
@go-jet what do you think about simply exposing the 'templates' as files the user can override?
Right now, file_templates.go contains all these static data. You can use embed.FS and have a fallback to read from a predefined directory like jet_templates/table.tmpl.go
It would allow users to add their own customizations without being forced to commit the change upstream and wait for a release?
@go-jet what do you think about simply exposing the 'templates' as files the user can override?
Exposing template file will make them part of the public API, which entails a commitment to maintain and support them unchanged until the next major release. There are also numerous FuncMap functions, not just static data. Exposing these internal implementation details could limit future refactoring options, as changes would need to avoid breaking the public contract. For the time being, I'd prefer to keep template private.
If a developer needs to customize the template, they always have the option to fork the project and implement any necessary modifications.
I need to generate my go structs in a different package. The package name is repo.
Currently the generator will always generate with package name model, enum or table.
Solution (preferred):
I'd like another parameter to be added that allows me to define the go package name for the generated files. (Or multiple parameters for each package)
jet -dsn=postgres://$APP_DATABASE_USER:$APP_DATABASE_PASSWORD@localhost:$APP_DATABASE_PORT/$APP_DATABASE_NAME?sslmode=disable -schema=public -path=./.gen
-gopkgmodel=entities, -gopkgtable=something, -gopkgenum=dbenums
Something like this would help a lot!
#208 does not solve my issue. I think this should be easily accessible via CLI.
The text was updated successfully, but these errors were encountered: