Basic preparation steps are required to see examples in action.
- Install PyEXASOL with optional dependencies.
- Download PyEXASOL source code and unzip it.
- Make sure Exasol is installed and dedicated schema for testing is created. You may use free Exasol Community Edition for testing purposes.
- Open
/examples/
directory and edit file\_config.py
. Input your Exasol credentials. - Run script to prepare data set for testing:
python examples/00_prepare.py
That's all. Now you may run examples in any order like common python scripts. E.g.:
python examples/01_basic.py
- 01_basic.py - minimal code to create connection and run query;
- 02_fetch_tuple.py - all methods of fetching result set returning tuples;
- 03_fetch_dict.py - all methods of fetching result set returning dictionaries;
- 04_fetch_mapper.py - adding custom data type mapper for fetching;
- 05_formatting.py - SQL text formatting;
- 06_pandas.py - IMPORT / EXPORT to and from
pandas.DataFrame
; - 07_import_export.py - other methods of IMPORT / EXPORT;
- 08_transaction.py - transaction management, autocommit;
- 09_exceptions.py - error handling, common errors;
- 10_redundancy.py - connection redundancy, how driver handles missing nodes;
- 11_edge_case.py - storing and fetching biggest and smallest values for data types available in Exasol;
- 12_db2_compat.py - DB-API 2.0 compatibility wrapper;
- 13_ext.py - extension functions to help with common Exasol-related problems outside of pure database driver scope;
- 14_parallel_export.py - multi-process HTTP transport for export;
- 15_encryption.py - SSL-encrypted WebSocket connection and HTTP transport;
- 16_ujson.py - edge case example with
ujson
; - 17_rapidjson.py - edge case example with
rapidjson
; - 18_session_params.py - passing custom session parameters
client_name
,client_version
; - 19_local_config.py - connect using local config file;
- 20_parallel_import.py - multi-process HTTP transport for import;
- 21_parallel_export_import.py - multi-process HTTP transport for export followed by import;
- 22_profiling.py - last query profiling;
- 23_snapshot_transactions.py - snapshot transactions mode, which may help with metadata locking problems;
- 24_script_output.py - run query with UDF script and capture output (may not work on local laptop);
- 25_overload.py - how to extend core PyEXASOL classes to add custom logic;
- 26_quote_ident.py - how to enable quoted identifiers for
import_*
,export_*
and other relevant functions; - 27_abort_query.py - how to abort running query using separate thread;
- 28_thread_safety.py - built-in protection from accessing connection object from multiple threads simultaneously;
- 29_dsn_parsing.py - parsing of complex connection strings and catching relevant exceptions;
- 30_http_proxy.py - connection via HTTP proxy;