Typed SQL Queries for nested prisma/sql directories
Hello I am considering the new Typed SQL feature and building some modular, scalable file structure for my queries. Something like:
Is there a mechanism for this yet? Might it be in scope?
Should I consider instead, or in the meantime a flat structure? Such as the following:
This is a cool feature and a data engineer who hasn't worked with TS before can contribute now to our project app. Keep up the good work!
1 Reply
I actually found that underscores work such as
admin__get_chatsList.sql
which works for me now
I'll just add that I think the TypeScript API is still a superior DX where you can be very dynamic with the select and where clauses, for example. That offers a scalable, modular option while you are building your app. The Typed SQL option is probably only preferable for a single-purpose use case, like a complex query that is only needed in one place.