Skip to content

place queries in a module #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eEQK opened this issue Dec 22, 2024 · 0 comments
Open

place queries in a module #50

eEQK opened this issue Dec 22, 2024 · 0 comments

Comments

@eEQK
Copy link

eEQK commented Dec 22, 2024

Say you have 2 queries:
GetPostsByUser and GetCommentsByUser

to make the development experience better say you want to have them grouped by "resource" instead:
PostsGetByUser and CommentsGetByUser
so that when you start typing posts in LSP suggestions you will see all queries for that resource

At this point why not place them together in a single module? it will put less burden on LSP server if you have a lot of queries (since by default all queries are exported to a top-level scope)

const userPosts = Posts.getByUser(sql)

I did create a POC implementation that you can see here in my fork (there was a naming fix along the way which is not included in this commit): eEQK@32827fb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant