Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/CreateDatabaseRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Request body for POST /databases

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**expires_at** | **str** | When this database expires. Accepts either an RFC 3339 timestamp (e.g. `\"2026-06-01T00:00:00Z\"`) or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days) — for example `\"24h\"`, `\"48h\"`, or `\"7d\"`. Defaults to `\"24h\"` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. | [optional]
**expires_at** | **str** | When this database expires. Accepts either an RFC 3339 timestamp (e.g. `\"2026-06-01T00:00:00Z\"`) or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days) — for example `\"24h\"`, `\"48h\"`, or `\"7d\"`. Omitted (or empty) means the database never expires. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. | [optional]
**name** | **str** | Optional free-form display label (for UIs/CLIs). Not unique. Not an identifier — databases are always addressed by `id`. Accepts the legacy `description` key as an alias so clients that predate the rename keep populating this field. | [optional]
**schemas** | [**List[DatabaseDefaultSchemaDecl]**](DatabaseDefaultSchemaDecl.md) | Optional schemas/tables to declare on the database's auto-created `default` catalog. Mirrors the `config.schemas` field of a managed `POST /v1/connections`. Tables declared here can be loaded via the standard managed-table load endpoint targeting `default_connection_id`. Omitted or empty means the default catalog starts empty. | [optional]
**storage_backend** | **str** | Physical storage backend for the database's auto-created `default` catalog. `\"parquet\"` (default) uses the versioned parquet cache. `\"ducklake\"` stores data in a DuckLake catalog in the shared metadata DB configured via `ducklake.metadata_pg_url`, which must be configured for that value to be accepted. Omitted means `\"parquet\"`. | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/DatabasesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void (empty response body)

Create database

Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`, with a `main` schema pre-declared so `default.main.<table>` works out of the box. The optional `name` is a free-form display label and is not required to be unique. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. Defaults to `24h` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp.
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`, with a `main` schema pre-declared so `default.main.<table>` works out of the box. The optional `name` is a free-form display label and is not required to be unique. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. When omitted, the database never expires. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. Optional `storage_backend` selects the physical backend for the default catalog — `parquet` (default) or `ducklake` (requires `ducklake.metadata_pg_url` to be configured).

### Example

Expand Down
13 changes: 9 additions & 4 deletions docs/DatasetsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ Method | HTTP request | Description


# **create_dataset**
> CreateDatasetResponse create_dataset(create_dataset_request)
> CreateDatasetResponse create_dataset(create_dataset_request, x_database_id=x_database_id)

Create dataset

Create a new dataset from an uploaded file or inline data. The dataset becomes a queryable table under the `datasets` schema (e.g., `SELECT * FROM datasets.my_table`). Supports CSV, JSON, and Parquet formats. Optionally specify explicit column types.
Create a new dataset from an uploaded file, inline data, a URL, or a SQL/saved query. The dataset becomes a queryable table under the `datasets` schema (e.g., `SELECT * FROM datasets.my_table`). Supports CSV, JSON, and Parquet formats. Optionally specify explicit column types.

For `sql_query` / `saved_query` sources the dataset materializes by running that SQL, so the `X-Database-Id` header is required and the query sees only that database's catalogs (the scope is also reused on refresh). Upload/url/inline sources ignore the header.

### Example

Expand Down Expand Up @@ -65,10 +67,11 @@ with hotdata.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hotdata.DatasetsApi(api_client)
create_dataset_request = hotdata.CreateDatasetRequest() # CreateDatasetRequest |
x_database_id = 'x_database_id_example' # str | Required for query-backed datasets (sql_query / saved_query): the database whose catalogs the materializing query runs against. An unknown id is a 404. (optional)

try:
# Create dataset
api_response = api_instance.create_dataset(create_dataset_request)
api_response = api_instance.create_dataset(create_dataset_request, x_database_id=x_database_id)
print("The response of DatasetsApi->create_dataset:\n")
pprint(api_response)
except Exception as e:
Expand All @@ -83,6 +86,7 @@ with hotdata.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**create_dataset_request** | [**CreateDatasetRequest**](CreateDatasetRequest.md)| |
**x_database_id** | **str**| Required for query-backed datasets (sql_query / saved_query): the database whose catalogs the materializing query runs against. An unknown id is a 404. | [optional]

### Return type

Expand All @@ -102,7 +106,8 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | Dataset created | - |
**400** | Invalid request | - |
**400** | Invalid request (query-backed dataset without X-Database-Id) | - |
**404** | Database (from X-Database-Id) not found | - |
**409** | Dataset already exists | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down
12 changes: 5 additions & 7 deletions docs/QueryApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ Method | HTTP request | Description

Execute SQL query

Execute a SQL query against all registered connections and datasets. Use standard Postgres-compatible SQL to reference tables from any connection using the format `connection_name.schema.table`. Results are returned inline and a `result_id` is provided for later retrieval via the Results API.
Execute a SQL query scoped to a database. A database is the only window into catalogs: the query sees only that database's auto `default` catalog plus any catalogs explicitly attached to it. Select the database with EITHER the `X-Database-Id` header OR the `database_id` body field (exactly one must be given; if both are sent and disagree, that's a 400). Use standard Postgres-compatible SQL; reference the default catalog as `default.<schema>.<table>` (or just `<schema>.<table>` / `<table>`) and attached catalogs by their alias. Results are returned inline and a `result_id` is provided for later retrieval via the Results API.

Set `async: true` to execute asynchronously — returns a query run ID for polling. Optionally set `async_after_ms` to attempt synchronous execution first, falling back to async if the query exceeds the timeout.

Set the `X-Database-Id` header to scope the query to a specific database. Inside a database scope the query only sees that database's auto `default` catalog plus any catalogs explicitly attached to it; workspace catalogs are invisible.

### Example

* Api Key Authentication (WorkspaceId):
Expand Down Expand Up @@ -64,7 +62,7 @@ with hotdata.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hotdata.QueryApi(api_client)
query_request = hotdata.QueryRequest() # QueryRequest |
x_database_id = 'x_database_id_example' # str | Scope the query to a specific database (its id). When set, only the database's attached catalogs are visible during planning. A malformed value is a 400; an unknown database id is a 404. (optional)
x_database_id = 'x_database_id_example' # str | Database id to scope the query to. Required unless the `database_id` body field is set; if both are present they must match. Only that database's catalogs are visible during planning. A malformed value is a 400; an unknown database id is a 404. (optional)

try:
# Execute SQL query
Expand All @@ -83,7 +81,7 @@ with hotdata.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query_request** | [**QueryRequest**](QueryRequest.md)| |
**x_database_id** | **str**| Scope the query to a specific database (its id). When set, only the database&#39;s attached catalogs are visible during planning. A malformed value is a 400; an unknown database id is a 404. | [optional]
**x_database_id** | **str**| Database id to scope the query to. Required unless the &#x60;database_id&#x60; body field is set; if both are present they must match. Only that database&#39;s catalogs are visible during planning. A malformed value is a 400; an unknown database id is a 404. | [optional]

### Return type

Expand All @@ -104,8 +102,8 @@ Name | Type | Description | Notes
|-------------|-------------|------------------|
**200** | Query executed successfully | - |
**202** | Query submitted asynchronously | - |
**400** | Invalid request | - |
**404** | Database (from X-Database-Id) not found | - |
**400** | Invalid request (no database specified, or header/body database_id conflict) | - |
**404** | Database not found | - |
**500** | Internal server error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down
5 changes: 3 additions & 2 deletions docs/QueryRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**var_async** | **bool** | When true, execute the query asynchronously and return a query run ID for polling via GET /query-runs/{id}. The query results can be retrieved via GET /results/{id} once the query run status is \&quot;succeeded\&quot;. | [optional]
**async_after_ms** | **int** | If set with async&#x3D;true, wait up to this many milliseconds for the query to complete synchronously before returning an async response. Minimum 1000ms. Ignored if async is false. | [optional]
**default_catalog** | **str** | Catalog that unqualified table references resolve against. Only honored inside an &#x60;X-Database-Id&#x60; scope; sending it without that header is a 400. Must name a catalog visible in the database (&#x60;default&#x60;, an attached catalog alias, or a system catalog). Defaults to &#x60;default&#x60; when omitted. | [optional]
**default_schema** | **str** | Schema that unqualified table references resolve against. Only honored inside an &#x60;X-Database-Id&#x60; scope; sending it without that header is a 400. Defaults to &#x60;main&#x60; when omitted. Existence is not validated up front — an unknown schema surfaces as a \&quot;table not found\&quot; error at planning time. | [optional]
**database_id** | **str** | Database to scope the query to (its id). Alternative to the &#x60;X-Database-Id&#x60; header — exactly one source must be provided. If both this field and the header are set and they disagree, the request is rejected with a 400. | [optional]
**default_catalog** | **str** | Catalog that unqualified table references resolve against within the query&#39;s database scope. Must name a catalog visible in the database (&#x60;default&#x60;, an attached catalog alias, or a system catalog). Defaults to &#x60;default&#x60; when omitted. | [optional]
**default_schema** | **str** | Schema that unqualified table references resolve against within the query&#39;s database scope. Defaults to &#x60;main&#x60; when omitted. Existence is not validated up front — an unknown schema surfaces as a \&quot;table not found\&quot; error at planning time. | [optional]
**sql** | **str** | |

## Example
Expand Down
11 changes: 7 additions & 4 deletions docs/SavedQueriesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **execute_saved_query**
> QueryResponse execute_saved_query(id, execute_saved_query_request=execute_saved_query_request)
> QueryResponse execute_saved_query(id, x_database_id, execute_saved_query_request=execute_saved_query_request)

Execute saved query

Execute a saved query. By default runs the latest version. Optionally specify a version number to execute a previous version. Returns the same response format as POST /v1/query.
Execute a saved query, scoped to a database (required `X-Database-Id` header). By default runs the latest version. Optionally specify a version number to execute a previous version. The SQL runs inside the given database scope, the same way POST /v1/query does. Returns the same response format as POST /v1/query.

### Example

Expand Down Expand Up @@ -227,11 +227,12 @@ with hotdata.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hotdata.SavedQueriesApi(api_client)
id = 'id_example' # str | Saved query ID
x_database_id = 'x_database_id_example' # str | Required. Scope execution to this database (its id). A missing or malformed value is a 400; an unknown database id is a 404.
execute_saved_query_request = hotdata.ExecuteSavedQueryRequest() # ExecuteSavedQueryRequest | Optional version to execute (optional)

try:
# Execute saved query
api_response = api_instance.execute_saved_query(id, execute_saved_query_request=execute_saved_query_request)
api_response = api_instance.execute_saved_query(id, x_database_id, execute_saved_query_request=execute_saved_query_request)
print("The response of SavedQueriesApi->execute_saved_query:\n")
pprint(api_response)
except Exception as e:
Expand All @@ -246,6 +247,7 @@ with hotdata.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| Saved query ID |
**x_database_id** | **str**| Required. Scope execution to this database (its id). A missing or malformed value is a 400; an unknown database id is a 404. |
**execute_saved_query_request** | [**ExecuteSavedQueryRequest**](ExecuteSavedQueryRequest.md)| Optional version to execute | [optional]

### Return type
Expand All @@ -266,7 +268,8 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Query executed | - |
**404** | Saved query not found | - |
**400** | Invalid request (including a missing X-Database-Id header) | - |
**404** | Saved query or database not found | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand Down
Loading
Loading