You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each service has its own queries.sql file, and I would like the generated Go files (e.g., auth.sql.go, customers.sql.go, etc.) to be placed in their respective directories with the correct package name.
Currently, I need to create separate blocks in the sqlc.yml file for each service manually, like this:
This works, but it can get repetitive as the number of services grows.
My question is:
Does sqlc plan to support a way to automatically detect and generate code for multiple directories and packages based on the queries.sql file location? For example, if queries.sql is in service/customers/, the generated code would automatically go to service/customers/ with the customers package name.
If not, is this something that could be considered for future releases?
What database engines need to be changed?
No response
What programming language backends need to be changed?
No response
The text was updated successfully, but these errors were encountered:
Its not that bad if you exploit yaml defaults. You just add "override" lines for each service.
This is true, but sqlc still generates models.go and db.go file with the same content for each directory/package, which is especially annoying in case described here (a single schema file as a source). I'd expect, in this situation, to be able to generate just one models.go and one db.go file for a project.
What do you want to change?
Question:
Hi, I’m using
sqlc
in my project, and I have a modular service structure like this:Each service has its own
queries.sql
file, and I would like the generated Go files (e.g.,auth.sql.go
,customers.sql.go
, etc.) to be placed in their respective directories with the correct package name.Currently, I need to create separate blocks in the
sqlc.yml
file for each service manually, like this:This works, but it can get repetitive as the number of services grows.
My question is:
Does
sqlc
plan to support a way to automatically detect and generate code for multiple directories and packages based on thequeries.sql
file location? For example, ifqueries.sql
is inservice/customers/
, the generated code would automatically go toservice/customers/
with thecustomers
package name.If not, is this something that could be considered for future releases?
What database engines need to be changed?
No response
What programming language backends need to be changed?
No response
The text was updated successfully, but these errors were encountered: