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

Question : Is there any way we could create different interfaces for different sql files?? #997

Unanswered
sagar23sj asked this question in Q&A
Discussion options

Current Behaviour :
I have 3 .sql files and when I am compiling them using sqlc generate(keeping emit_interface flag true), a single interface is created for all the auto-generated SQL queries.

Expected Behaviour :
Wanted to have different interfaces for different table operations.

Not having separate interface for each SQL file is creating a common interface which gets bulky everytime I add a query.

Can anyone suggest any way if possible to generate separate interfaces for separate SQL files?

Thanks

You must be logged in to vote

Replies: 1 comment

Comment options

Having a separate Querier interface for each file would make test mocking easier. Querier on its own isn't terribly useful for APIs that are treating each table as a resource. I think the only suitable workaround is to create your own interface for each table/resource/etc. which is a subset of Querier.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #996 on May 03, 2021 16:47.

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