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/a00_prepare.py
That's all. Now you may run examples in any order like common python scripts. E.g.:
python examples/a01_basic.py
- a01_basic.py - minimal code to create connection and run query;
- a02_fetch_tuple.py - all methods of fetching result set returning tuples;
- a03_fetch_dict.py - all methods of fetching result set returning dictionaries;
- a04_fetch_mapper.py - apply custom data type mapper for fetching;
- a05_formatting.py - SQL text formatting;
- a06_transaction.py - transaction management, autocommit;
- a07_exceptions.py - error handling for basic SQL queries;
- a08_ext.py - extension functions to help with common problems outside of scope of database driver;
- a09_abort_query.py - abort running query from separate thread;
- a10_context_manager.py - use WITH clause for
ExaConnection
andExaStatement
objects; - a11_insert_multi - INSERT small number of rows using prepared statements instead of HTTP transport;
- a12_meta - lock-free meta data requests;
- a13_meta_nosql - no-SQL metadata commands introduces in Exasol v7.0+;
- b01_pandas.py - IMPORT / EXPORT to and from
pandas.DataFrame
; - b02_import_export.py - other methods of IMPORT / EXPORT;
- b03_parallel_export.py - multi-process HTTP transport for EXPORT;
- b04_parallel_import.py - multi-process HTTP transport for IMPORT;
- b05_parallel_export_import.py - multi-process HTTP transport for EXPORT followed by IMPORT;
- b06_http_transport_errors - various ways to break HTTP transport and handle errors;
- c01_redundancy.py - connection redundancy, handling of missing nodes;
- c02_edge_case.py - storing and fetching biggest and smallest values for data types available in Exasol;
- c03_db2_compat.py - DB-API 2.0 compatibility wrapper;
- c04_encryption.py - SSL-encrypted WebSocket connection and HTTP transport;
- c05_session_params.py - passing custom session parameters
client_name
,client_version
, etc.; - c06_local_config.py - connect using local config file;
- c07_profiling.py - last query profiling;
- c08_snapshot_transactions.py - snapshot transactions mode, which may help with metadata locking problems;
- c09_script_output.py - run query with UDF script and capture output (may not work on local laptop);
- c10_overload.py - extend core PyEXASOL classes to add custom logic;
- c11_quote_ident.py - enable quoted identifiers for
import_*
,export_*
and other relevant functions; - c12_thread_safety.py - built-in protection from accessing connection object from multiple threads simultaneously;
- c13_dsn_parsing.py - parsing of complex connection strings and catching relevant exceptions;
- c14_http_proxy.py - connection via HTTP proxy;
- c15_garbage_collection - detect potential garbage collection problems due to cross-references;
- j01_rapidjson.py - JSON library
rapidjson
; - j02_ujson.py - JSON library
ujson
; - j03_orjson.py - JSON library
orjson
;