-
Notifications
You must be signed in to change notification settings - Fork 265
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
Added basic functionalities of REST apis #1234
Conversation
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.
👋 Hello @imnidhi, thanks for submitting a EVA DB PR 🙏 To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify that your PR is up-to-date with
georgia-tech-db/eva
master
branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by runninggit pull
andgit merge master
locally. - ✅ Verify that all EVA DB Continuous Integration (CI) checks are passing.
- ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition.
apps/rest/run_evadb.py
Outdated
return {"response" : res.to_json()} | ||
|
||
@app.route('/query/<query>',methods = ['GET']) | ||
def query_from_db(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.
I think all we need is the query. The rest is not necessary. However, we need to optimize the query endpoint. Some I can think of now:
- we may need a queue to serialize concurrent queries. @jiashenC has done some setup similar for slackbot. You can refer to that.
- We may also need the response to be streaming, considering we have a very large table as the result.
Other than query, we can also have a upload endpoint for users to upload their csvs, pdfs, videos.
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.
Hey Andy. I added the upload endpoint. Could you take a look in my latest commit?
Hi @imnidhi, looks great! Could you
@gaurav274 @jarulraj Any idea on how to add a testcase for rest APIs? |
apps/rest/run_evadb.py
Outdated
app.secret_key = "evadb-rest-apis" | ||
|
||
# Get Query response | ||
@app.route('/query/<query>',methods = ['GET']) |
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.
SQL queries usually have space. I am wondering how this will work. Does the user need to escape the url?
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.
No. I tried with spaces and it automatically converts it to escape char so it should be fine
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.
Also I added an input box similar to upload. It's easier to enter text that way
No description provided.