From ef7d4c2db732fc20dad54f9538abbb03fce1a2cb Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 14 Mar 2023 00:32:11 +0100 Subject: [PATCH 1/4] Documentation: Improve landing page and other sections across the board --- DEVELOP.rst | 8 +- README.rst | 47 +++--- docs/appendices/index.rst | 14 -- docs/by-example/index.rst | 10 +- docs/{appendices => }/data-types.rst | 0 docs/getting-started.rst | 39 +++-- docs/index-all.rst | 22 +++ docs/index.rst | 218 +++++++++++++++++++++++---- docs/other-options.rst | 55 +++++++ docs/sqlalchemy.rst | 20 ++- 10 files changed, 335 insertions(+), 98 deletions(-) delete mode 100644 docs/appendices/index.rst rename docs/{appendices => }/data-types.rst (100%) create mode 100644 docs/index-all.rst create mode 100644 docs/other-options.rst diff --git a/DEVELOP.rst b/DEVELOP.rst index 7424eafe..b8fcaeae 100644 --- a/DEVELOP.rst +++ b/DEVELOP.rst @@ -1,12 +1,14 @@ -=============== -Developer guide -=============== +============================== +CrateDB Python developer guide +============================== Setup ===== To start things off, bootstrap the sandbox environment:: + git clone https://github.com/crate/crate-python + cd crate-python source bootstrap.sh This command should automatically install all prerequisites for the development diff --git a/README.rst b/README.rst index c2b7ccba..f3cf23e9 100644 --- a/README.rst +++ b/README.rst @@ -45,20 +45,14 @@ A Python client library for CrateDB_. This library: -- Implements the Python `DB API 2.0`_ specification -- Includes support for SQLAlchemy_ (>= 1.3.0) - -Prerequisites -============= - -Recent versions of this library are validated on Python 3 (>= 3.7). -It may also work on earlier versions of Python. +- Implements the Python `DB API 2.0`_ specification. +- Includes support for SQLAlchemy_ in form of an `SQLAlchemy dialect`_. Installation ============ -The CrateDB Python client is available as a pip_ package. +The CrateDB Python client is available as package `crate`_ on `PyPI`_. To install the most recent driver version, including the SQLAlchemy dialect extension, run:: @@ -66,29 +60,34 @@ extension, run:: $ pip install "crate[sqlalchemy]" --upgrade -Contributing -============ +Documentation and help +====================== -This project is primarily maintained by Crate.io_, but we welcome community -contributions! +- `CrateDB Python Client documentation`_ +- `CrateDB reference documentation`_ +- `Developer documentation`_ +- `Contributing`_ +- Other `support channels`_ -See the `developer docs`_ and the `contribution docs`_ for more information. -Help -==== +Contributing +============ -Looking for more help? +The CrateDB Python client library is an open source project, and is `managed on +GitHub`_. We appreciate contributions of any kind. -- Read the `project docs`_ -- Check out our `support channels`_ -.. _contribution docs: CONTRIBUTING.rst +.. _Contributing: CONTRIBUTING.rst +.. _crate: https://pypi.org/project/crate/ .. _Crate.io: https://crate.io/ .. _CrateDB: https://github.com/crate/crate -.. _DB API 2.0: http://www.python.org/dev/peps/pep-0249/ -.. _developer docs: DEVELOP.rst -.. _pip: https://pypi.python.org/pypi/pip +.. _CrateDB Python Client documentation: https://crate.io/docs/python/ +.. _CrateDB reference documentation: https://crate.io/docs/reference/ +.. _DB API 2.0: https://peps.python.org/pep-0249/ +.. _Developer documentation: DEVELOP.rst +.. _managed on GitHub: https://github.com/crate/crate-python +.. _PyPI: https://pypi.org/ .. _SQLAlchemy: https://www.sqlalchemy.org +.. _SQLAlchemy dialect: https://docs.sqlalchemy.org/dialects/ .. _StackOverflow: https://stackoverflow.com/tags/cratedb .. _support channels: https://crate.io/support/ -.. _project docs: https://crate.io/docs/python/ diff --git a/docs/appendices/index.rst b/docs/appendices/index.rst deleted file mode 100644 index ae83ef5f..00000000 --- a/docs/appendices/index.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _appendices: - -========== -Appendices -========== - -Supplementary information for the CrateDB Python client library. - -.. rubric:: Table of contents - -.. toctree:: - :maxdepth: 2 - - data-types diff --git a/docs/by-example/index.rst b/docs/by-example/index.rst index dcb9be4c..54f90ce8 100644 --- a/docs/by-example/index.rst +++ b/docs/by-example/index.rst @@ -1,3 +1,5 @@ +.. _by-example: + ########## By example ########## @@ -11,10 +13,10 @@ This part of the documentation contains examples how to use the CrateDB Python client. -DBAPI, HTTP, and BLOB interfaces -================================ +DB API, HTTP, and BLOB interfaces +================================= -The examples in this section are all about CrateDB's `Python DBAPI`_ interface, +The examples in this section are all about CrateDB's `Python DB API`_ interface, the plain HTTP API interface, and a convenience interface for working with :ref:`blob tables `. It details attributes, methods, and behaviors of the ``Connection`` and ``Cursor`` objects. @@ -48,5 +50,5 @@ its corresponding API interfaces, see also :ref:`sqlalchemy-support`. sqlalchemy/inspection-reflection -.. _Python DBAPI: https://peps.python.org/pep-0249/ +.. _Python DB API: https://peps.python.org/pep-0249/ .. _SQLAlchemy: https://www.sqlalchemy.org/ diff --git a/docs/appendices/data-types.rst b/docs/data-types.rst similarity index 100% rename from docs/appendices/data-types.rst rename to docs/data-types.rst diff --git a/docs/getting-started.rst b/docs/getting-started.rst index 699b1253..a0ae8d09 100644 --- a/docs/getting-started.rst +++ b/docs/getting-started.rst @@ -4,28 +4,20 @@ Getting started =============== -Learn how to install and get started the :ref:`CrateDB Python client library -`. +Learn how to install and get started with the Python client library for +`CrateDB`_. .. rubric:: Table of contents .. contents:: :local: -Prerequisites -============= - -Recent versions of this library are validated on Python 3 (>= 3.7). -It may also work on earlier versions of Python. - -`Pip`_ should be installed on your system. - Install ======= .. highlight:: sh -The CrateDB Python client is `available`_ as a `PyPI`_ package. +The CrateDB Python client is available as package `crate`_ on `PyPI`_. To install the most recent driver version, including the SQLAlchemy dialect extension, run:: @@ -43,9 +35,9 @@ Interactive use Python provides a REPL_, also known as an interactive language shell. It's a handy way to experiment with code and try out new libraries. We recommend -`iPython`_, which you can install, like so:: +`IPython`_, which you can install, like so:: - pip install iPython + pip install ipython Once installed, you can start it up, like this:: @@ -53,27 +45,32 @@ Once installed, you can start it up, like this:: From there, try importing the CrateDB Python client library and seeing how far you get with the built-in ``help()`` function (that can be called on any -object), iPython's autocompletion, and many other features. +object), IPython's autocompletion, and many other features. .. SEEALSO:: - `The iPython Documentation`_ + `The IPython Documentation`_ Set up as a dependency ====================== -In order to handle Python project dependencies, there are `many ways`_. -The official PyPI package should be compatible with all of them. +There are `many ways`_ to add the ``crate`` package as a dependency to your +project. All of them work equally well. Please note that you may want to employ +package version pinning in order to keep the environment of your project stable +and reproducible, achieving `repeatable installations`_. + Next steps ========== Learn how to :ref:`connect to CrateDB `. -.. _available: https://pypi.python.org/pypi/pip -.. _iPython: https://ipython.org/ + +.. _crate: https://pypi.org/project/crate/ +.. _CrateDB: https://crate.io/products/cratedb/ +.. _IPython: https://ipython.org/ .. _many ways: https://packaging.python.org/key_projects/ -.. _Pip: https://pip.pypa.io/en/stable/installing/ .. _PyPI: https://pypi.org/ +.. _repeatable installations: https://pip.pypa.io/en/latest/topics/repeatable-installs/ .. _REPL: https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop -.. _The iPython Documentation: https://ipython.readthedocs.io/en/stable/ +.. _The IPython Documentation: https://ipython.readthedocs.io/ diff --git a/docs/index-all.rst b/docs/index-all.rst new file mode 100644 index 00000000..85a508e9 --- /dev/null +++ b/docs/index-all.rst @@ -0,0 +1,22 @@ +:orphan: + +.. _index-all: + +################################## +CrateDB Python Client -- all pages +################################## + + +.. rubric:: Table of contents + +.. toctree:: + :maxdepth: 2 + + getting-started + connect + query + blobs + sqlalchemy + data-types + by-example/index + other-options diff --git a/docs/index.rst b/docs/index.rst index 147353a0..189c1d97 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,51 +1,211 @@ .. _index: -===================== +##################### CrateDB Python Client -===================== +##################### -A Python client library for `CrateDB`_. +.. rubric:: Table of contents -This client library implements the `Python Database API Specification v2.0`_ -(PEP 249), which defines a common interface for accessing databases in Python. +.. contents:: + :local: + :depth: 1 -It also includes the :ref:`CrateDB dialect ` for `SQLAlchemy`_. -.. NOTE:: +************ +Introduction +************ - This is a basic CrateDB driver reference. +The Python client library for `CrateDB`_ implements the Python Database API +Specification v2.0 (`PEP 249`_), and also includes the :ref:`CrateDB dialect +` for `SQLAlchemy`_. - Check out the `sample application`_ (and the corresponding `sample - application documentation`_) for a practical demonstration of this driver - in use. +The Python driver can be used to connect to both `CrateDB OSS`_ and `CrateDB +Cloud`_, and is verified to work on Linux, macOS, and Windows. It is used by +the `Crash CLI`_, as well as other libraries and applications connecting to +CrateDB from the Python ecosystem. It is verified to work with CPython, but +it has also been tested successfully with `PyPy`_. - For general help using the Python Database API or SQLAlchemy, please consult - `PEP 249`_, the `SQLAlchemy tutorial`_, or the `SQLAlchemy documentation`_. +Please make sure to also visit the section about :ref:`other-options`, using +the :ref:`crate-reference:interface-postgresql` interface of `CrateDB`_. -.. SEEALSO:: - The CrateDB Python client library is an open source project and is `hosted - on GitHub`_. +************* +Documentation +************* -.. rubric:: Table of contents +For general help about the Python Database API, or SQLAlchemy, please consult +`PEP 249`_, the `SQLAlchemy tutorial`_, and the general `SQLAlchemy +documentation`_. + +For more detailed information about how to install the client driver, how to +connect to a CrateDB cluster, and how to run queries, consult the resources +referenced below. A dedicated section demonstrates how to use the :ref:`blob +storage capabilities ` of CrateDB. .. toctree:: - :maxdepth: 2 + :titlesonly: + + getting-started + connect + query + blobs + + +DB API +====== + +Install package from PyPI. + +.. code-block:: shell + + $ pip install crate + +Connect to CrateDB instance running on ``localhost``. + +.. code-block:: python + + >>> # Connect using DB API. + >>> from crate import client + >>> with client.connect("localhost:4200", username="crate") as connection: + >>> cursor = connection.cursor() + >>> cursor.execute("SELECT * FROM sys.summits;") + >>> print(cursor.fetchall()) + >>> cursor.close() + +Connect to `CrateDB Cloud`_. + +.. code-block:: python + + >>> # Connect using DB API. + >>> from crate import client + >>> client.connect("https://admin:iM_n1%0xRzShsapU4U(lDGOj@example.aks1.westeurope.azure.cratedb.net:4200") + + +SQLAlchemy +========== + +The CrateDB dialect for `SQLAlchemy`_ offers convenient ORM access and supports +CrateDB's ``OBJECT``, ``ARRAY``, and geospatial data types using `GeoJSON`_, +supporting different kinds of `GeoJSON geometry objects`_. + +.. toctree:: + :maxdepth: 2 + + sqlalchemy + +Install package from PyPI with DB API and SQLAlchemy support. + +.. code-block:: shell + + $ pip install crate[sqlalchemy] pandas + +Connect to CrateDB instance running on ``localhost``. + +.. code-block:: python + + >>> # Connect using SQLAlchemy Core. + >>> import sqlalchemy as sa + >>> engine = sa.create_engine("crate://localhost:4200", echo=True) + >>> with engine.connect() as connection: + >>> with connection.execute(sa.text("SELECT * FROM sys.summits;")) as cursor: + >>> print(cursor.fetchall()) + +Connect to `CrateDB Cloud`_. + +.. code-block:: python + + >>> # Connect using SQLAlchemy Core. + >>> import sqlalchemy as sa + >>> engine = sa.create_engine("crate://admin:iM_n1%0xRzShsapU4U(lDGOj@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true", echo=True) + +Load results into `pandas`_ DataFrame. + +.. code-block:: python + + >>> # Connect using SQLAlchemy Core and pandas. + >>> import pandas as pd + >>> import sqlalchemy as sa + >>> engine = sa.create_engine("crate://localhost:4200", echo=True) + >>> with engine.connect() as connection: + >>> df = pd.read_sql(sql=sa.text("SELECT * FROM sys.summits;"), con=connection) + >>> df.info() + >>> print(df) + + +Data types +========== + +The DB API driver and the SQLAlchemy dialect support :ref:`CrateDB's data types +` to different degrees. For more information, +please consult the :ref:`data-types` and :ref:`SQLAlchemy extension types +` documentation pages. + +Examples +======== + +- The :ref:`by-example` section enumerates concise examples demonstrating the + different API interfaces of the CrateDB Python client library. Those are + DB API, HTTP, and BLOB interfaces, and the SQLAlchemy dialect. +- The `sample application`_ and the corresponding `sample application + documentation`_ demonstrate the use of the driver on behalf of an example + "guestbook" application. +- `Use CrateDB with pandas`_ has corresponding code snippets about how to + connect to CrateDB using `pandas`_, and how to load and export data. +- The `Apache Superset`_ and `FIWARE QuantumLeap data historian`_ projects. + + +******************* +Project information +******************* + +Resources +========= +- `Source code `_ +- `Documentation `_ +- `Python Package Index (PyPI) `_ + +Contributions +============= +The CrateDB Python client library is an open source project, and is `managed on +GitHub`_. +Every kind of contribution, feedback, or patch, is much welcome. `Create an +issue`_ or submit a patch if you think we should include a new feature, or to +report or fix a bug. + +Development +=========== +In order to setup a development environment on your workstation, please head +over to the `development sandbox`_ documentation. When you see the software +tests succeed, you should be ready to start hacking. + +Page index +========== +The full index for all documentation pages can be inspected at :ref:`index-all`. + +License +======= +The project is licensed under the terms of the Apache 2.0 license, like CrateDB +itself, see `LICENSE`_. - getting-started - connect - query - blobs - sqlalchemy - by-example/index - appendices/index +.. _Apache Superset: https://github.com/apache/superset +.. _Crash CLI: https://crate.io/docs/crate/crash/ .. _CrateDB: https://crate.io/products/cratedb/ -.. _hosted on GitHub: https://github.com/crate/crate-python -.. _PEP 249: https://www.python.org/dev/peps/pep-0249/ -.. _Python Database API Specification v2.0: https://www.python.org/dev/peps/pep-0249/ +.. _CrateDB Cloud: https://console.cratedb.cloud/ +.. _CrateDB OSS: https://github.com/crate/crate +.. _Create an issue: https://github.com/crate/crate-python/issues +.. _development sandbox: https://github.com/crate/crate-python/blob/master/DEVELOP.rst +.. _FIWARE QuantumLeap data historian: https://github.com/orchestracities/ngsi-timeseries-api +.. _GeoJSON: https://geojson.org/ +.. _GeoJSON geometry objects: https://tools.ietf.org/html/rfc7946#section-3.1 +.. _LICENSE: https://github.com/crate/crate-python/blob/master/LICENSE +.. _managed on GitHub: https://github.com/crate/crate-python +.. _pandas: https://pandas.pydata.org/ +.. _PEP 249: https://peps.python.org/pep-0249/ +.. _PyPy: https://www.pypy.org/ .. _sample application: https://github.com/crate/crate-sample-apps/tree/main/python-flask .. _sample application documentation: https://github.com/crate/crate-sample-apps/blob/main/python-flask/documentation.md .. _SQLAlchemy: https://www.sqlalchemy.org/ .. _SQLAlchemy documentation: https://docs.sqlalchemy.org/ -.. _SQLAlchemy tutorial: https://docs.sqlalchemy.org/en/latest/orm/tutorial.html +.. _SQLAlchemy tutorial: https://docs.sqlalchemy.org/en/latest/tutorial/ +.. _Use CrateDB with pandas: https://github.com/crate/crate-qa/pull/246 diff --git a/docs/other-options.rst b/docs/other-options.rst new file mode 100644 index 00000000..95e5a0ad --- /dev/null +++ b/docs/other-options.rst @@ -0,0 +1,55 @@ +.. _other-options: + +##################################### +Other connectivity options for Python +##################################### + + +************ +Introduction +************ + +Using the :ref:`crate-reference:interface-postgresql` interface of `CrateDB`_, +there are a few other connectivity options for Python. This section enumerates +the verified drivers, together with some example and test case code using them. + + +******* +Details +******* + +- `asyncpg`_, see `testing CrateDB with asyncpg`_. + +- `psycopg2`_ + + The `CrateDB Astronomer/Airflow tutorials`_ repository includes a few + orchestration examples implemented using `Apache Airflow`_ DAGs for different + import and export tasks, and for automating recurrent queries. It accompanies + a series of articles starting with `CrateDB and Apache Airflow » Automating + Data Export to S3`_. + +- `psycopg3`_, see `testing CrateDB with psycopg3`_. + +- ODBC connectivity is offered by `pyodbc`_ and `turbodbc`_, see + `testing CrateDB with pyodbc`_ and `using CrateDB with turbodbc`_. + +- `connector-x`_ promises to be the fastest library to load data from DB to + DataFrames in Rust and Python. It is the designated database connector + library for `Apache Arrow DataFusion`_. + + +.. _asyncpg: https://github.com/MagicStack/asyncpg +.. _Apache Airflow: https://github.com/apache/airflow +.. _Apache Arrow DataFusion: https://github.com/apache/arrow-datafusion +.. _connector-x: https://github.com/sfu-db/connector-x +.. _CrateDB: https://github.com/crate/crate +.. _CrateDB Astronomer/Airflow tutorials: https://github.com/crate/crate-airflow-tutorial +.. _CrateDB and Apache Airflow » Automating Data Export to S3: https://community.crate.io/t/cratedb-and-apache-airflow-automating-data-export-to-s3/901 +.. _pyodbc: https://github.com/mkleehammer/pyodbc +.. _psycopg2: https://github.com/psycopg/psycopg2 +.. _psycopg3: https://github.com/psycopg/psycopg +.. _Testing CrateDB with asyncpg: https://github.com/crate/crate-qa/blob/master/tests/client_tests/python/asyncpg/test_asyncpg.py +.. _Testing CrateDB with psycopg3: https://github.com/crate/crate-qa/blob/master/tests/client_tests/python/psycopg3/test_psycopg3.py +.. _Testing CrateDB with pyodbc: https://github.com/crate/crate-qa/blob/master/tests/client_tests/odbc/test_pyodbc.py +.. _turbodbc: https://github.com/blue-yonder/turbodbc +.. _Using CrateDB with turbodbc: https://github.com/crate/cratedb-examples/pull/18 diff --git a/docs/sqlalchemy.rst b/docs/sqlalchemy.rst index fd19be30..ee228a0c 100644 --- a/docs/sqlalchemy.rst +++ b/docs/sqlalchemy.rst @@ -15,15 +15,15 @@ SQLAlchemy support Introduction ============ -`SQLAlchemy`_ is a popular `Object-Relational Mapping`_ (ORM) library for -Python. +`SQLAlchemy`_ is the most popular `Object-Relational Mapping`_ (ORM) library +for Python. The CrateDB Python client library provides support for SQLAlchemy. An :ref:`SQLAlchemy dialect ` for CrateDB is registered at installation time and can be used without further configuration. The CrateDB SQLAlchemy dialect is validated to work with SQLAlchemy versions -``1.3`` and ``1.4``. +``1.3``, ``1.4``, and ``2.0``. .. SEEALSO:: @@ -154,6 +154,19 @@ Once you have an CrateDB ``engine`` set up, you can create and use an SQLAlchemy SQLAlchemy has more documentation about this topic on :doc:`sa:orm/session_basics`. + +.. _cloud-connect: + +Connecting to CrateDB Cloud +........................... + +Connecting to `CrateDB Cloud`_ works like this. Please note the ``?ssl=true`` +query parameter at the end of the database URI. + + >>> import sqlalchemy as sa + >>> engine = sa.create_engine("crate://admin:iM_n1%0xRzShsapU4U(lDGOj@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true", echo=True) + + .. _tables: Tables @@ -654,6 +667,7 @@ column on the ``Character`` class. .. _arguments reference: https://crate.io/docs/crate/reference/en/latest/general/dql/fulltext.html#arguments .. _boost values: https://crate.io/docs/crate/reference/en/latest/general/dql/fulltext.html#arguments .. _count result rows: https://docs.sqlalchemy.org/en/14/orm/tutorial.html#counting +.. _CrateDB Cloud: https://console.cratedb.cloud/ .. _Database API: https://www.python.org/dev/peps/pep-0249/ .. _geojson geometry objects: https://www.rfc-editor.org/rfc/rfc7946#section-3.1 .. _match options: https://crate.io/docs/crate/reference/en/latest/general/dql/fulltext.html#options From 8235a75be02249e6480f21bab2141ae608e33f52 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 14 Mar 2023 12:26:32 +0100 Subject: [PATCH 2/4] Documentation: Refine the landing page once more --- docs/index.rst | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 189c1d97..1efc4ead 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -19,7 +19,7 @@ The Python client library for `CrateDB`_ implements the Python Database API Specification v2.0 (`PEP 249`_), and also includes the :ref:`CrateDB dialect ` for `SQLAlchemy`_. -The Python driver can be used to connect to both `CrateDB OSS`_ and `CrateDB +The Python driver can be used to connect to both `CrateDB`_ and `CrateDB Cloud`_, and is verified to work on Linux, macOS, and Windows. It is used by the `Crash CLI`_, as well as other libraries and applications connecting to CrateDB from the Python ecosystem. It is verified to work with CPython, but @@ -78,7 +78,10 @@ Connect to `CrateDB Cloud`_. >>> # Connect using DB API. >>> from crate import client - >>> client.connect("https://admin:iM_n1%0xRzShsapU4U(lDGOj@example.aks1.westeurope.azure.cratedb.net:4200") + >>> connection = client.connect( + ... servers="https://example.aks1.westeurope.azure.cratedb.net:4200", + ... username="admin", + ... password="") SQLAlchemy @@ -97,7 +100,7 @@ Install package from PyPI with DB API and SQLAlchemy support. .. code-block:: shell - $ pip install crate[sqlalchemy] pandas + $ pip install 'crate[sqlalchemy]' pandas Connect to CrateDB instance running on ``localhost``. @@ -116,7 +119,8 @@ Connect to `CrateDB Cloud`_. >>> # Connect using SQLAlchemy Core. >>> import sqlalchemy as sa - >>> engine = sa.create_engine("crate://admin:iM_n1%0xRzShsapU4U(lDGOj@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true", echo=True) + >>> dburi = "crate://admin:@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true" + >>> engine = sa.create_engine(dburi, echo=True) Load results into `pandas`_ DataFrame. @@ -184,15 +188,15 @@ The full index for all documentation pages can be inspected at :ref:`index-all`. License ======= -The project is licensed under the terms of the Apache 2.0 license, like CrateDB -itself, see `LICENSE`_. +The project is licensed under the terms of the Apache 2.0 license, like +`CrateDB itself `_, see `LICENSE`_. .. _Apache Superset: https://github.com/apache/superset .. _Crash CLI: https://crate.io/docs/crate/crash/ -.. _CrateDB: https://crate.io/products/cratedb/ +.. _CrateDB: https://crate.io/products/cratedb .. _CrateDB Cloud: https://console.cratedb.cloud/ -.. _CrateDB OSS: https://github.com/crate/crate +.. _CrateDB source: https://github.com/crate/crate .. _Create an issue: https://github.com/crate/crate-python/issues .. _development sandbox: https://github.com/crate/crate-python/blob/master/DEVELOP.rst .. _FIWARE QuantumLeap data historian: https://github.com/orchestracities/ngsi-timeseries-api From 14028867ed2a028f9878c9c930dc4300f0bd57cc Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 14 Mar 2023 12:29:18 +0100 Subject: [PATCH 3/4] Documentation: Refine SQLAlchemy documentation re. CrateDB Cloud connect --- docs/sqlalchemy.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/sqlalchemy.rst b/docs/sqlalchemy.rst index ee228a0c..00bf5d00 100644 --- a/docs/sqlalchemy.rst +++ b/docs/sqlalchemy.rst @@ -164,7 +164,8 @@ Connecting to `CrateDB Cloud`_ works like this. Please note the ``?ssl=true`` query parameter at the end of the database URI. >>> import sqlalchemy as sa - >>> engine = sa.create_engine("crate://admin:iM_n1%0xRzShsapU4U(lDGOj@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true", echo=True) + >>> dburi = "crate://admin:@example.aks1.westeurope.azure.cratedb.net:4200?ssl=true" + >>> engine = sa.create_engine(dburi, echo=True) .. _tables: From 77d7ba6e3a3ce365a99fbca928c51c3cc51b8a23 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 14 Mar 2023 12:33:58 +0100 Subject: [PATCH 4/4] fixup! Documentation: Refine the landing page once more --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 1efc4ead..989c275e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -189,7 +189,7 @@ The full index for all documentation pages can be inspected at :ref:`index-all`. License ======= The project is licensed under the terms of the Apache 2.0 license, like -`CrateDB itself `_, see `LICENSE`_. +`CrateDB itself `_, see `LICENSE`_. .. _Apache Superset: https://github.com/apache/superset