Install
Connection parameters
Authenticate with OAuth 2.0
secure=True.
Cursor API
See also
- Query e6data from Python
- Connecting to the engine
- REST API for SQL queries, a driverless alternative
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Connection parameters and the cursor API of the e6data Python connector.
pip install --no-cache-dir e6data-python-connector
from e6data_python_connector import Connection
conn = Connection(
host="<host>",
port=443,
username="<email>",
password="<access token>",
database="<schema>",
cluster_name="<cluster_name>",
secure=True,
)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
host | str | Yes | Hostname of the e6data cluster endpoint. | |
port | int | Yes | Port of the endpoint. Use the port shown under Cluster → Connectivity. | |
username | str | Conditional | None | Your e6data email. Required unless you authenticate with OAuth. |
password | str | Conditional | None | A personal access token. Required unless you authenticate with OAuth. |
database | str | No | None | The schema (database) to query. |
catalog | str | No | None | The catalog name. |
cluster_name | str | No | None | The cluster to run queries on. |
secure | bool | No | False | Set True to use TLS. |
ssl_cert | str or bytes | No | None | Path to a CA certificate (PEM), or the certificate bytes. |
auto_resume | bool | No | True | Resume the cluster automatically if it’s suspended. |
grpc_options | dict | No | None | Extra gRPC options. |
debug | bool | No | False | Turn on debug logging. |
require_fastbinary | bool | No | True | Set False to use the pure-Python deserializer when the native build dependencies can’t be installed. |
client_id, client_secret, token_url | str | No | None | OAuth 2.0 client-credentials settings. Use instead of username and password. |
oauth_scope | str | No | None | Space-separated scopes to request. |
access_token | str | No | None | A token you minted yourself. The connector doesn’t refresh it. |
client_auth_method | str | No | "basic" | How client credentials reach the token endpoint: "basic" or "post". |
username/password and OAuth settings raises a ValueError.conn = Connection(
host="<host>",
port=443,
database="<schema>",
cluster_name="<cluster_name>",
secure=True,
client_id="<client_id>",
client_secret="<client_secret>",
token_url="https://<your-workspace>/oauth2/token",
)
secure=True.
cursor = conn.cursor(catalog_name="<catalog>")
query_id = cursor.execute("SELECT * FROM <table>")
rows = cursor.fetchall()
| Method | What it does |
|---|---|
conn.cursor(catalog_name=...) | Opens a cursor scoped to a catalog. |
cursor.execute(query) | Runs a statement and returns its query ID. |
cursor.fetchall() | Returns all rows. |
cursor.fetchone() | Returns one row. |
cursor.fetchmany(n) | Returns up to n rows. |
cursor.fetchall_buffer() | Returns a generator that streams rows, to keep memory low on large results. |
cursor.explain_analyse() | Returns the execution plan and statistics after a query runs. |
cursor.cancel(query_id) | Aborts a running query. |
cursor.clear() | Frees cached results. Not needed after aborting a query. |
cursor.close() | Closes the cursor. |
conn.get_schema_names() | Lists databases (schemas). |
conn.get_tables(database=...) | Lists tables in a database. |
conn.close() | Closes the connection. |