Skip to content

How to reuse/extend types from existing queries from submodule? #3967

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

Open
ribtoks opened this issue May 15, 2025 · 0 comments
Open

How to reuse/extend types from existing queries from submodule? #3967

ribtoks opened this issue May 15, 2025 · 0 comments

Comments

@ribtoks
Copy link

ribtoks commented May 15, 2025

Hi

I have a following situation:

  • Repository "base" has some queries and migrations ("schema"), that are processed by sqlc
  • Repository "specific" has "base" as a submodule (and vendors) and adds few more queries/migrations

Now the problem is that whenever sqlc is compiling queries from submodule "specific", it's also re-generating half of the types from "base", just because they are referenced in queries (I have to provide references in schema: to those tables as otherwise sqlc isn't able to process queries at all). So I end up from identical "copy-pasted" types in generated code.

Quesion: how to reuse generated types from "base"?

override just does not work here, I assume it's because it's for query arguments, columns, not for actual entities ("table types")

Note: I'm using sqlc 1.29.0 and project is in Go.

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

No branches or pull requests

1 participant