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

Single model package that's shared to multiple query packages #1941

Open
GeertJohan opened this issue Nov 9, 2022 · 3 comments
Open

Single model package that's shared to multiple query packages #1941

GeertJohan opened this issue Nov 9, 2022 · 3 comments
Labels
enhancement New feature or request 🔧 golang

Comments

@GeertJohan
Copy link

What do you want to change?

I'm working on a repository where we have four sqlc-generated packages. Currently, sqlc generates the models.go file for each package; which leads to a lot of duplicated code. I was wondering if it would make sense to have an sqlc.yaml config option to create a single models package, which is then used by the query packages.

This issue is related to #835, but I think my feature request goes a bit further as it needs multiple query packages to all refer to the same models package.

What database engines need to be changed?

No response

What programming language backends need to be changed?

Go

@GeertJohan GeertJohan added enhancement New feature or request triage New issues that hasn't been reviewed labels Nov 9, 2022
@taylow
Copy link

taylow commented Nov 10, 2022

Just opened a similar issue with breaking out generation paths to the config #1951 would love to see some more configurability in the generated files!

@ludusrusso-rc
Copy link

@kyleconroy this feature would help me a lot, it ok for you if I try to implement it?

@mpyw
Copy link
Contributor

mpyw commented Jul 6, 2023

mpyw/sqlc-restruct: Post-processor for kyleconroy/sqlc

Post-processing approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🔧 golang
Projects
None yet
Development

No branches or pull requests

5 participants