From 94e17a98685ad5a26c01085df2b32924b932dd31 Mon Sep 17 00:00:00 2001 From: jarulraj Date: Fri, 1 Sep 2023 00:31:56 -0400 Subject: [PATCH] updates --- docs/source/overview/connect-to-database.rst | 89 ++++++++++++++------ docs/source/overview/getting-started.rst | 2 +- docs/source/reference/databases/index.rst | 4 +- 3 files changed, 64 insertions(+), 31 deletions(-) diff --git a/docs/source/overview/connect-to-database.rst b/docs/source/overview/connect-to-database.rst index 73ddd07978..76a60b0d07 100644 --- a/docs/source/overview/connect-to-database.rst +++ b/docs/source/overview/connect-to-database.rst @@ -1,59 +1,92 @@ Connect to Database ============================ -EvaDB supports an extensive data sources for both structured and unstructured data. +EvaDB supports an extensive range of data sources for structured and unstructured data. -1. Connect to an existing structured data source. +.. note:: + + Learn more about structured and unstructured data in :doc:`Data Sources `. + + +Connect to a SQL Database System +-------------------------------- + +1. Use the `CREATE DATABASE` statement to connect to an existing SQL database. .. code-block:: python cursor.query(""" - CREATE DATABASE postgres_data WITH ENGINE = 'postgres', PARAMETERS = { - "user": "eva", - "password": "password", - "host": "localhost", - "port": "5432", - "database": "evadb" - };""").df() + CREATE DATABASE restaurant_reviews + WITH ENGINE = 'postgres', + PARAMETERS = { + "user": "eva", + "password": "password", + "host": "localhost", + "port": "5432", + "database": "restaurant_reviews" + };""").df() .. note:: - Check :ref:`Create DATABASE statement` for syntax documentation and :ref:`Data Sources` for all supported data source engines. - -The above query connects to an exsiting Postgres database, which allows us to build AI applications in EvaDB without data migration. -For example, the following query previews the available data using :ref:`SELECT`. + Go over the :ref:`CREATE DATABASE` statement for more details. The :ref:`Databases` page lists all the database systems that EvaDB currently supports. -.. code-block:: python - - cursor.query("SELECT * FROM postgres_data.food_review;").df() +2. Preview the Available Data Using `SELECT` -We can also run native queries in the connected database by the :ref:`USE` statement. +You can now preview the available data in the `restaurant_reviews` database with a standard :ref:`SELECT` statement. .. code-block:: python cursor.query(""" - USE postgres_data { - INSERT INTO food_review (name, review) VALUES ('Customer 1', 'I ordered fried rice but it is too salty.') - };""").df() + SELECT * + FROM restaurant_reviews.food_review; + """).df() +3. Run Native Queries in the Connected Database With `USE` -2. Load unstructured data. EvaDB supports a wide range of type of unstructured data. Below are some examples: +You can also run native queries directly in the connected database system by the :ref:`USE` statement. .. code-block:: python - + cursor.query( - "LOAD IMAGE 'reddit-images/*.jpg' INTO reddit_dataset;" - ).df() + """ + USE restaurant_reviews { + INSERT INTO food_review (name, review) + VALUES ( + 'Customer 1', + 'I ordered fried rice but it is too salty.' + ) + }; + """).df() + -We load the local reddit image dataset into EvaDB. +Load Unstructured Data +----------------------- + +EvaDB supports diverse types of unstructured data. Here are some examples: + +1. Load Images from Local Filesystem + +You can load a collection of images obtained from Reddit from the local filesystem into EvaDB using the :ref:`LOAD` statement. .. code-block:: python + + cursor.query(""" + LOAD IMAGE 'reddit-images/*.jpg' + INTO reddit_dataset; + """).df() - cursor.query("LOAD VIDEO 's3://bucket/eva_videos/mnist.mp4' INTO MNISTVid;").df() +2. Load Video from Cloud Bucket -We load the MNIST video from s3 bucket into EvaDB. +You can load a video from an S3 cloud bucket into EvaDB using the :ref:`LOAD` statement. + +.. code-block:: python + + cursor.query(""" + LOAD VIDEO 's3://bucket/eva_videos/mnist.mp4' + INTO MNISTVid; + """).df() .. note:: - Check :ref:`LOAD statement` for all types of supported unstructured data. + Go over the :ref:`LOAD statement` statement for more details on the types of unstructured data that EvaDB supports. diff --git a/docs/source/overview/getting-started.rst b/docs/source/overview/getting-started.rst index ff559cd132..3c5df180f9 100644 --- a/docs/source/overview/getting-started.rst +++ b/docs/source/overview/getting-started.rst @@ -93,7 +93,7 @@ You should see a list of built-in functions including but not limited to the fol .. note:: - EvaDB supports additional installation options for extending its functionality. Go over the :doc:`Additional Installation Options ` for all the available options. + EvaDB supports additional installation options for extending its functionality. Go over the :doc:`Installation Options ` for all the available options. Illustrative AI App ------------------- diff --git a/docs/source/reference/databases/index.rst b/docs/source/reference/databases/index.rst index fab16ad548..6686d5b998 100644 --- a/docs/source/reference/databases/index.rst +++ b/docs/source/reference/databases/index.rst @@ -1,6 +1,6 @@ -.. _data-sources: +.. _databases: -Data Sources +Databases ============= Below are all supported data sources for EvaDB. We welcome adding new data source integrations in EvaDB. Check :ref:`add-data-source` for guidance.