diff --git a/docs/_toc.yml b/docs/_toc.yml index 7efb746f28..f30a389971 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -67,6 +67,7 @@ parts: - file: source/reference/databases/sqlite - file: source/reference/databases/mysql - file: source/reference/databases/mariadb + - file: source/reference/databases/github - file: source/reference/ai/index title: AI Engines diff --git a/docs/source/reference/databases/github.rst b/docs/source/reference/databases/github.rst new file mode 100644 index 0000000000..79f8197528 --- /dev/null +++ b/docs/source/reference/databases/github.rst @@ -0,0 +1,56 @@ +Github +========== + +The connection to Github is based on the `PyGithub `_ library. + +Dependency +---------- + +* PyGithub + + +Parameters +---------- + +Required: + +* ``owner`` is the owner of the Github repository. For example, georgia-tech-db is the owner of the EvaDB repository. +* ``repo`` is the name of the Github repository. For example, evadb is the name of this repository. + +Optional: + +* ``github_token`` is not required for public repositories. However, the rate limit is lower without a valid github_token. Check `Rate limits page `_ to learn more about how to check your rate limit status. Check `Managing your personal access tokens page `_ to learn how to create personal access tokens. + +Create Connection +----------------- + +.. code-block:: text + + CREATE DATABASE github_data WITH ENGINE = 'github', PARAMETERS = { + "owner": "georgia-tech-db", + "repo": "evadb" + }; + +Supported Tables +---------------- + +* ``stargazers``: Lists the people that have starred the repository. Check `evadb/third_party/databases/github/table_column_info.py` for all the available columns in the table. + +.. code-block:: sql + + SELECT * FROM github_data.stargazers; + +Here is the query output: + +.. code-block:: + + +---------------------------------------------------+-----+---------------------------------------------+ + | stargazers.avatar_url | ... | stargazers.url | + |---------------------------------------------------|-----|---------------------------------------------| + | https://avatars.githubusercontent.com/u/105357... | ... | https://api.github.com/users/jaehobang | + | https://avatars.githubusercontent.com/u/436141... | ... | https://api.github.com/users/VineethAljapur | + +---------------------------------------------------+-----+---------------------------------------------+ + +.. note:: + + Looking for another table from Github? You can add a table mapping in `evadb/third_party/databases/github/github_handler.py`, or simply raise a `Feature Request `_.