From 906528bdf401a63ad12e9feafacb66ad80855043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Tue, 17 Dec 2024 17:16:36 +0100 Subject: [PATCH 1/3] Docs for installing extensions --- docs/datamodel/extensions.rst | 56 +++++++++++++++++++++++++++++++++++ setup.py | 1 - 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/docs/datamodel/extensions.rst b/docs/datamodel/extensions.rst index 743312e6035..23cf80c9272 100644 --- a/docs/datamodel/extensions.rst +++ b/docs/datamodel/extensions.rst @@ -8,10 +8,66 @@ Extensions are the way EdgeDB adds more functionality. In principle, extensions could add new types, scalars, functions, etc., but, more importantly, they can add new ways of interacting with the database. +Built-in extensions +------------------- + +There is a few built-in extensions available: + - ``edgeql_http``: enables :ref:`EdgeQL over HTTP ` - ``graphql``: enables :ref:`GraphQL ` - ``auth``: enables :ref:`EdgeDB Auth ` +.. _ref_datamodel_using_extension: + +To enable these extensions, they need to be declared in the schema via ``using`` +statement: + +.. code:: sdl + + using extension auth; + + +Standalone extensions +--------------------- + +Additionally, standalone extension packages can be installed via the CLI: + +.. code:: bash + + $ edgedb extension list -I my_instance + ┌─────────┬─────────┐ + │ Name │ Version │ + └─────────┴─────────┘ + + $ edgedb extension list-available -I my_instance + ┌─────────┬───────────────┐ + │ Name │ Version │ + │ postgis │ 3.4.3+6b82d77 │ + └─────────┴───────────────┘ + + $ edgedb extension install -I my_instance -E postgis + Found extension package: postgis version 3.4.3+6b82d77 + 00:00:03 [====================] 22.49 MiB/22.49 MiB + Extension 'postgis' installed successfully. + + $ edgedb extension list -I my_instance + ┌─────────┬───────────────┐ + │ Name │ Version │ + │ postgis │ 3.4.3+6b82d77 │ + └─────────┴───────────────┘ + +After installing extensions, make sure to restart your instance: + +.. code:: bash + + $ edgedb instance restart -I my_instance + +Standalone extensions can now be declared in the schema, same as :ref:`built-in +extensions `. + +To restore a dump that uses a standalone extension, that extension has installed +before the restore process. + .. list-table:: :class: seealso diff --git a/setup.py b/setup.py index 5532ff45e04..9c9cfb8e9dc 100644 --- a/setup.py +++ b/setup.py @@ -550,7 +550,6 @@ def _compile_cli(build_base, build_temp): check=True, ) - for dest in ('gel', 'edgedb'): cli_dest = ROOT_PATH / 'edb' / 'cli' / dest # Delete the target first, to avoid "Text file busy" errors during From 06605743892bc94de939a61973128cc88c30fab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Tue, 17 Dec 2024 18:44:40 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Scott Trinh --- docs/datamodel/extensions.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/datamodel/extensions.rst b/docs/datamodel/extensions.rst index 23cf80c9272..c9b3aef55fc 100644 --- a/docs/datamodel/extensions.rst +++ b/docs/datamodel/extensions.rst @@ -11,7 +11,7 @@ importantly, they can add new ways of interacting with the database. Built-in extensions ------------------- -There is a few built-in extensions available: +There are a few built-in extensions available: - ``edgeql_http``: enables :ref:`EdgeQL over HTTP ` - ``graphql``: enables :ref:`GraphQL ` @@ -19,12 +19,12 @@ There is a few built-in extensions available: .. _ref_datamodel_using_extension: -To enable these extensions, they need to be declared in the schema via ``using`` -statement: +To enable these extensions, add a ``using`` statement at the top level of your schema: .. code:: sdl using extension auth; + Standalone extensions @@ -65,7 +65,7 @@ After installing extensions, make sure to restart your instance: Standalone extensions can now be declared in the schema, same as :ref:`built-in extensions `. -To restore a dump that uses a standalone extension, that extension has installed +To restore a dump that uses a standalone extension, that extension must be installed before the restore process. From 0a314d6cc8abb8b9297d6f89c20e69a0b9ec40c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Tue, 17 Dec 2024 20:07:45 +0100 Subject: [PATCH 3/3] fix --- docs/datamodel/extensions.rst | 41 +++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/docs/datamodel/extensions.rst b/docs/datamodel/extensions.rst index c9b3aef55fc..d76174c4961 100644 --- a/docs/datamodel/extensions.rst +++ b/docs/datamodel/extensions.rst @@ -13,15 +13,28 @@ Built-in extensions There are a few built-in extensions available: -- ``edgeql_http``: enables :ref:`EdgeQL over HTTP ` -- ``graphql``: enables :ref:`GraphQL ` -- ``auth``: enables :ref:`EdgeDB Auth ` +- ``edgeql_http``: enables :ref:`EdgeQL over HTTP `, +- ``graphql``: enables :ref:`GraphQL `, +- ``auth``: enables :ref:`EdgeDB Auth `, +- ``ai``: enables :ref:`ext::ai module `, + +- ``pg_trgm``: enables ``ext::pg_trgm``, which re-exports + `pgtrgm `__, + +- ``pg_unaccent``: enables ``ext::pg_unaccent``, which re-exports + `unaccent `__, + +- ``pgcrypto``: enables ``ext::pgcrypto``, which re-exports + `pgcrypto `__, + +- ``pgvector``: enables ``ext::pgvector``, which re-exports + `pgvector `__, .. _ref_datamodel_using_extension: To enable these extensions, add a ``using`` statement at the top level of your schema: -.. code:: sdl +.. code-block:: sdl using extension auth; @@ -30,26 +43,40 @@ To enable these extensions, add a ``using`` statement at the top level of your s Standalone extensions --------------------- -Additionally, standalone extension packages can be installed via the CLI: +Additionally, standalone extension packages can be installed via the CLI. + +List installed extensions: -.. code:: bash +.. code-block:: bash $ edgedb extension list -I my_instance ┌─────────┬─────────┐ │ Name │ Version │ └─────────┴─────────┘ +List available extensions: + +.. code-block:: bash + $ edgedb extension list-available -I my_instance ┌─────────┬───────────────┐ │ Name │ Version │ │ postgis │ 3.4.3+6b82d77 │ └─────────┴───────────────┘ +Install the ``postgis`` extension: + +.. code-block:: bash + $ edgedb extension install -I my_instance -E postgis Found extension package: postgis version 3.4.3+6b82d77 00:00:03 [====================] 22.49 MiB/22.49 MiB Extension 'postgis' installed successfully. +Check that extension is installed: + +.. code-block:: bash + $ edgedb extension list -I my_instance ┌─────────┬───────────────┐ │ Name │ Version │ @@ -58,7 +85,7 @@ Additionally, standalone extension packages can be installed via the CLI: After installing extensions, make sure to restart your instance: -.. code:: bash +.. code-block:: bash $ edgedb instance restart -I my_instance