-
-
Couldn't load subscription status.
- Fork 36
Query engine #320
Query engine #320
Conversation
src/api/query.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why'd we did a class implementation ? The created instance was never passed outside this function. So there is no need for a class here.
Give a read on Separation of concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem we want to solve is that earlier there was this useTrino flag passed around everywhere which is error prone. How do you propose to fix that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am more than happy if you can propose a better / idiomatic approach on how to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Even now, we are sending the 'queryEngine' in place of 'useTrino'. So no difference.
- App initializes only one time. We should assume the query engine the first time itself and save it as a boolean (useTrino: boolean, since we are not going to include any other connector anytime soon) in the AppProvider. So we dont have to compare the string everytime, everywhere.
- trinoquery & query endpoint definition should remain separate.
Stating all the above, we dont really need a class. Instead of passing the string everywhere, pass just the boolean since thats what we need at the end. Revert back all the changes and just set and set the useTrino (boolean) in the app provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing the string everywhere, pass just the boolean since thats what we need at the end.
We have to avoid this. It has to dynamically decide which engine to use based on API response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a very valid point if we are going to add more connectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now there is one, but we have to make it modular so we can extend as needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
about the endpoint def. 1 function to dynamically decide or separate endpoints for every connectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to include more connectors:
Then the class should provide everything for making a request.
All the logic related to query engine should be inside the class. Define separate urls for separate engines and the class should decide and return the url also.
src/hooks/useQueryResult.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove LIMIT OFFSET in normal query?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this for the count query
Support for multiple query engine
Changes