From c8316de9a951720b754b8e1f17c873ecbe61e720 Mon Sep 17 00:00:00 2001 From: Andy Xu Date: Fri, 1 Sep 2023 07:57:24 -0700 Subject: [PATCH] Add mysql as an available data source into documentation (#1025) 1. Fix link 2. Add mysql into https://evadb.readthedocs.io/en/latest/source/reference/databases/index.html 3. Add documentation requirements in https://evadb.readthedocs.io/en/latest/source/dev-guide/extend/new-data-source.html --- docs/_toc.yml | 1 + .../source/dev-guide/contribute/setup-dev.rst | 2 +- .../dev-guide/extend/new-data-source.rst | 7 ++++ docs/source/overview/connect-to-database.rst | 5 --- docs/source/overview/getting-started.rst | 3 +- .../getting-started/installation-options.rst | 2 +- docs/source/reference/databases/mysql.rst | 36 +++++++++++++++++++ docs/source/reference/evaql/create.rst | 2 +- 8 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 docs/source/reference/databases/mysql.rst diff --git a/docs/_toc.yml b/docs/_toc.yml index d9069bcec..89682d609 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -59,6 +59,7 @@ parts: title: Data Sources sections: - file: source/reference/databases/postgres + - file: source/reference/databases/mysql - file: source/reference/udfs/index title: Models diff --git a/docs/source/dev-guide/contribute/setup-dev.rst b/docs/source/dev-guide/contribute/setup-dev.rst index 0811cca51..6c9f69137 100644 --- a/docs/source/dev-guide/contribute/setup-dev.rst +++ b/docs/source/dev-guide/contribute/setup-dev.rst @@ -27,7 +27,7 @@ After installing the package locally, you can make changes and run the test case .. note:: EvaDB provides multiple installation options for extending its functionalities. - Please see :ref:`installation guide` for all options. + Please see :ref:`installation options` for all options. Other options can be installed with the ``dev`` environment. diff --git a/docs/source/dev-guide/extend/new-data-source.rst b/docs/source/dev-guide/extend/new-data-source.rst index 844262a8c..d6bdc1ce1 100644 --- a/docs/source/dev-guide/extend/new-data-source.rst +++ b/docs/source/dev-guide/extend/new-data-source.rst @@ -89,3 +89,10 @@ Add your created data source handler in `get_database_handler` function at `evad return mod.MydbHandler(engine, **kwargs) ... +Add the Data Source in Documentation +------------------------------------ + +Add your new data source into :ref:`databases` section for reference. + +- Create ``mydb.rst`` under `evadb/docs/source/reference/databases ` directory. You can refer to the existing documentation under the directory for example information to be covered in ``mydb.rst``. +- Update ``source/reference/databases/postgres`` in `evadb/docs/_toc.yml `. diff --git a/docs/source/overview/connect-to-database.rst b/docs/source/overview/connect-to-database.rst index 76a60b0d0..e74de58ca 100644 --- a/docs/source/overview/connect-to-database.rst +++ b/docs/source/overview/connect-to-database.rst @@ -3,11 +3,6 @@ Connect to Database EvaDB supports an extensive range of data sources for structured and unstructured data. -.. note:: - - Learn more about structured and unstructured data in :doc:`Data Sources `. - - Connect to a SQL Database System -------------------------------- diff --git a/docs/source/overview/getting-started.rst b/docs/source/overview/getting-started.rst index b8e9f23ea..16391e772 100644 --- a/docs/source/overview/getting-started.rst +++ b/docs/source/overview/getting-started.rst @@ -42,6 +42,7 @@ Now, activate the virtual environment: You should see a list of installed packages including but not limited to the following: .. code-block:: bash + Package Version ----------------- ------- aenum 3.1.15 @@ -141,4 +142,4 @@ Now, run the Python program: Try out EvaDB by experimenting with the introductory `MNIST notebook on Colab `_. .. note:: - Go over the :ref:`Python API` to learn more about the functions used in this app. \ No newline at end of file + Go over the :ref:`Python API` to learn more about the functions used in this app. diff --git a/docs/source/overview/getting-started/installation-options.rst b/docs/source/overview/getting-started/installation-options.rst index 18da1df7b..680497627 100644 --- a/docs/source/overview/getting-started/installation-options.rst +++ b/docs/source/overview/getting-started/installation-options.rst @@ -1,7 +1,7 @@ .. _installation options: Installation Options -================== +==================== EvaDB provides the following additional installation options for extending its functionality. diff --git a/docs/source/reference/databases/mysql.rst b/docs/source/reference/databases/mysql.rst new file mode 100644 index 000000000..0a1c67d23 --- /dev/null +++ b/docs/source/reference/databases/mysql.rst @@ -0,0 +1,36 @@ +MySQL +========== + +The connection to MySQL is based on the `mysql-connector-python `_ library. + +Dependency +---------- + +* mysql-connector-python + + +Parameters +---------- + +Required: + +* `user` is the database user. +* `password` is the database password. +* `host` is the host name, IP address, or URL. +* `port` is the port used to make TCP/IP connection. +* `database` is the database name. + + +Create Connection +----------------- + +.. code-block:: text + + CREATE DATABASE mysql_data WITH ENGINE = 'mysql', PARAMETERS = { + "user": "eva", + "password": "password", + "host": "localhost", + "port": "5432", + "database": "evadb" + }; + diff --git a/docs/source/reference/evaql/create.rst b/docs/source/reference/evaql/create.rst index 316283d9c..c92ad6f37 100644 --- a/docs/source/reference/evaql/create.rst +++ b/docs/source/reference/evaql/create.rst @@ -15,7 +15,7 @@ The CREATE DATABASE statement allows us to connect to an external structured dat PARAMETERS = [key_value_parameters]; * [database_connection] is the name of the database connection. `[database_connection].[table_name]` will be used as table name to compose SQL queries in EvaDB. -* [database_engine] is the supported database engine. Check :ref:`supported data sources` for all engine and their available configuration parameters. +* [database_engine] is the supported database engine. Check :ref:`supported data sources` for all engine and their available configuration parameters. * [key_value_parameters] is a list of key-value pairs as arguments to establish a connection.