Connection Parameters#
General SQLAlchemy Engine Parameters#
The table below lists parameters used in the Connection Specification.
Parameter |
Description |
|---|---|
drivername |
The name of the database backend.
For SQLAlchemy-Exasol, this is |
username |
The name of the user for authentication, e.g. |
password |
The password associated with the given username. This should not be encoded,
and special characters do not need to be escaped, e.g. |
host |
The host data source name (DSN) to access the database, e.g. |
port |
The port number to access the database, e.g. |
query |
A dictionary of string keys to string values to be passed
to the dialect upon connecting, e.g. |
connect_args |
A dictionary of options supported by the PyExasol WebSocket DBAPI,
passed to
|
Specific URL Query Parameters for SQLAlchemy-Exasol#
The table below lists URL query parameters supported by the SQLAlchemy-Exasol
dialect. Add them to the URL query string or the query dictionary passed to
URL.create; their values are supplied as strings and converted by the
dialect as needed.
Keyword |
Description |
|---|---|
AUTOCOMMIT |
This indicates if the connection automatically commits or not. The parsed value is case-insensitive.
|
ENCRYPTION |
This indicates if the connection should be encrypted or not. The parsed value is case-insensitive.
For more information about TLS encryption, please see Transport Layer Security (TLS). |
FINGERPRINT |
An alternate to SSL certificate verification is to verify the connection via a fingerprint.
For more information about fingerprint verification, please see Fingerprint Verification. |
SSLCertificate |
This indicates if the connection should verify the SSL certificate or not.
For more information about verifying the SSL certificate, please see About Certificate Verification. |
PyExasol Compatibility and Value Conversion#
SQLAlchemy-Exasol uses the WebSocket DBAPI provided by PyExasol. PyExasol 3.0.0 changed the default WebSocket DBAPI conversion so that values are converted to Python types as early as possible, in accordance with PEP 249.
The following table describes values exposed by SQLAlchemy-Exasol through the
WebSocket DBAPI. The PyExasol version columns show the version-dependent
behavior seen by SQLAlchemy-Exasol; None is returned for NULL values
for all types.
Exasol type |
SQLAlchemy-Exasol with PyExasol < 3.0.0 |
SQLAlchemy-Exasol with PyExasol >= 3.0.0 |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
metadata |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The SQLAlchemy column type declaration can change the Python type returned.
With PyExasol >= 3.0.0, a native Exasol DECIMAL(p, 0) value is returned as
int. If the column is instead declared with SQLAlchemy’s
Numeric(18, 0) type, SQLAlchemy applies its decimal result processor and
returns decimal.Decimal.
For release-specific conversion details and the complete list of changes, see the PyExasol 3.0.0 release notes.
Custom fetch mapper#
Applications can provide their own PyExasol fetch_mapper through
SQLAlchemy’s connect_args. The mapper receives (value, data_type) for
each fetched value, as described in PyExasol’s
DBAPI documentation.
It replaces PyExasol’s default mapper, so applications must handle the value
types they need. See the custom fetch mapper example.