Skip to content
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

feat(codogen): Added the ability to specify a separate package for models. #3379

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

MWT-proger
Copy link

@MWT-proger MWT-proger commented May 13, 2024

issue #835
issue #1951
issue #1941

This will allow you to create a clean project architecture.
I started using sqlc only yesterday. But I think it's a very interesting feature, and a lot of people need it.

Please tell me what needs to be fixed. I would like her to come out as soon as possible.

  • This feature has been tested with examples
  • This feature does not interfere with standard usage
  • It is necessary to add an example for this case
  • Add new options to the documentation
  • Added sorting import for generated files. Unused import are deleted, and those that are not specified are added.

…on level

using the package "golang.org/x/tools/imports "

This solves the problem in the same way as for packet separation. In the case when, for example, a package of models has been added to the interfaces, but it is not used there.

A problem was also identified due to the fact that the package was not added to the interfaces "github.com/jackc/pgx/v5/pgtype "

But the standard tool fixes these problems on its own
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant