atoti_directquery_redshift.connection_info module#

class atoti_directquery_redshift.RedshiftConnectionInfo#

Information needed to connect to a Redshift database.

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

Create a Redshift 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_redshift import RedshiftConnectionInfo
>>> connection_info = RedshiftConnectionInfo(
...     "jdbc:redshift://"
...     + os.environ["REDSHIFT_ACCOUNT_IDENTIFIER"]
...     + ".redshift.amazonaws.com:5439/dev?user="
...     + os.environ["REDSHIFT_USERNAME"]
...     + "&schema=test_resources",
...     password=os.environ["REDSHIFT_PASSWORD"],
... )