Skip to content

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

Description

@GeertJohan

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

Activity

  1. added
    enhancementNew feature or request
    triageNew issues that hasn't been reviewed
    on Nov 9, 2022
  2. taylow commented on Nov 10, 2022

    @taylow

    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!

  3. added and removed
    triageNew issues that hasn't been reviewed
    on Feb 22, 2023
  4. ludusrusso-rc commented on Apr 16, 2023

    @ludusrusso-rc

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

  5. mpyw commented on Jul 6, 2023

    @mpyw
    Contributor
  6. kyleconroy commented on May 5, 2026

    @kyleconroy
    Collaborator

    Fixed here #4421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions