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:
prisma/sql/
├── admin/
│ ├── chats/
│ ├── users/
│ └── ...
├── users/
├── chats/
├── messages/
└── ...
prisma/sql/
├── admin/
│ ├── chats/
│ ├── users/
│ └── ...
├── users/
├── chats/
├── messages/
└── ...
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:
prisma/sql/
├── adminChatsList.sql
├── adminChatsGetById.sql
├── adminUsersList.sql
├── adminUsersGetById.sql
├── adminUsersUpdate.sql
├── chatsList.sql
├── chatsGetById.sql
├── usersProfile.sql
└── ...
prisma/sql/
├── adminChatsList.sql
├── adminChatsGetById.sql
├── adminUsersList.sql
├── adminUsersGetById.sql
├── adminUsersUpdate.sql
├── chatsList.sql
├── chatsGetById.sql
├── usersProfile.sql
└── ...
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
pppaaattt
pppaaattt3d ago
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.
Want results from more Discord servers?
Add your server