Skip to content
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

Merged
merged 10 commits into from
Oct 15, 2023

Conversation

imnidhi
Copy link
Contributor

@imnidhi imnidhi commented Sep 28, 2023

No description provided.

Copy link
Contributor

@github-actions github-actions bot left a 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 running git pull and git 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 Show resolved Hide resolved
return {"response" : res.to_json()}

@app.route('/query/<query>',methods = ['GET'])
def query_from_db(query):
Copy link
Collaborator

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:

  1. we may need a queue to serialize concurrent queries. @jiashenC has done some setup similar for slackbot. You can refer to that.
  2. 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.

Copy link
Contributor Author

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?

@xzdandy xzdandy modified the milestone: v0.3.7 Sep 29, 2023
@xzdandy
Copy link
Collaborator

xzdandy commented Oct 12, 2023

Hi @imnidhi, looks great! Could you

  • fix the linter
  • add documentation on how to use the rest API
  • add some testcases if possible
    Thanks!

@gaurav274 @jarulraj Any idea on how to add a testcase for rest APIs?

app.secret_key = "evadb-rest-apis"

# Get Query response
@app.route('/query/<query>',methods = ['GET'])
Copy link
Collaborator

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?

Copy link
Contributor Author

@imnidhi imnidhi Oct 12, 2023

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

Copy link
Contributor Author

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

@xzdandy xzdandy merged commit 0bcd5df into georgia-tech-db:staging Oct 15, 2023
@xzdandy xzdandy added this to the v0.3.8 milestone Oct 18, 2023
RichardZhangRZ pushed a commit to RichardZhangRZ/evadb that referenced this pull request Oct 23, 2023
a0x8o pushed a commit to alexxx-db/eva that referenced this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

2 participants