Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Unanswered
ribtoks asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #3967 on August 03, 2025 03:40.

AltStyle によって変換されたページ (->オリジナル) /