atoti_directquery_databricks.connection_info module#

class atoti_directquery_databricks.DatabricksConnectionInfo#

Information needed to connect to a Databricks database.

__init__(url, /, *, password=None)#

Create a Databricks connection info.

Parameters:
  • url (str) – The JDBC connection string.

  • password (str | None) –

    The password to connect to the database.

    Passing it in this separate parameter allows to avoid having it logged alongside the connection string.

    If None, a password is expected to be present in the passed url.

Example

>>> import os
>>> from atoti_directquery_databricks import DatabricksConnectionInfo
>>> connection_info = DatabricksConnectionInfo(
...     "jdbc:databricks://"
...     + os.environ["DATABRICKS_SERVER_HOSTNAME"]
...     + "/default;"
...     + "transportMode=http;"
...     + "ssl=1;"
...     + "httpPath="
...     + os.environ["DATABRICKS_HTTP_PATH_LATEST"]
...     + ";"
...     + "AuthMech=3;"
...     + "UID=token;",
...     password=os.environ["DATABRICKS_AUTH_TOKEN"],
... )