Skip to content

Commit 7f5aa44

Browse files
committed
chore: regenerate client from OpenAPI spec
1 parent fee21e0 commit 7f5aa44

14 files changed

Lines changed: 108 additions & 44 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Typed `x_database_id` parameter on `SavedQueriesApi.execute_saved_query` (required) and `DatasetsApi.create_dataset`, scoping execution to a database the same way `QueryApi.query` does — no more `_headers` override.
13+
- `database_id` field on `QueryRequest` as a body-level alternative to the `X-Database-Id` header.
14+
- `storage_backend` field on `CreateDatabaseRequest` to select the default catalog's physical backend (`parquet` or `ducklake`).
15+
1016

1117
## [0.2.6] - 2026-05-29
1218

docs/CreateDatabaseRequest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Request body for POST /databases
66

77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
9-
**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]
9+
**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]
1010
**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]
1111
**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]
12+
**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]
1213

1314
## Example
1415

docs/DatabasesApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void (empty response body)
105105
106106
Create database
107107

108-
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.
108+
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).
109109

110110
### Example
111111

docs/DatasetsApi.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ Method | HTTP request | Description
1313

1414

1515
# **create_dataset**
16-
> CreateDatasetResponse create_dataset(create_dataset_request)
16+
> CreateDatasetResponse create_dataset(create_dataset_request, x_database_id=x_database_id)
1717
1818
Create dataset
1919

20-
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.
20+
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.
21+
22+
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.
2123

2224
### Example
2325

@@ -65,10 +67,11 @@ with hotdata.ApiClient(configuration) as api_client:
6567
# Create an instance of the API class
6668
api_instance = hotdata.DatasetsApi(api_client)
6769
create_dataset_request = hotdata.CreateDatasetRequest() # CreateDatasetRequest |
70+
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)
6871

6972
try:
7073
# Create dataset
71-
api_response = api_instance.create_dataset(create_dataset_request)
74+
api_response = api_instance.create_dataset(create_dataset_request, x_database_id=x_database_id)
7275
print("The response of DatasetsApi->create_dataset:\n")
7376
pprint(api_response)
7477
except Exception as e:
@@ -83,6 +86,7 @@ with hotdata.ApiClient(configuration) as api_client:
8386
Name | Type | Description | Notes
8487
------------- | ------------- | ------------- | -------------
8588
**create_dataset_request** | [**CreateDatasetRequest**](CreateDatasetRequest.md)| |
89+
**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]
8690

8791
### Return type
8892

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

108113
[[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)

docs/QueryApi.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ Method | HTTP request | Description
1212
1313
Execute SQL query
1414

15-
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.
15+
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.
1616

1717
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.
1818

19-
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.
20-
2119
### Example
2220

2321
* Api Key Authentication (WorkspaceId):
@@ -64,7 +62,7 @@ with hotdata.ApiClient(configuration) as api_client:
6462
# Create an instance of the API class
6563
api_instance = hotdata.QueryApi(api_client)
6664
query_request = hotdata.QueryRequest() # QueryRequest |
67-
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)
65+
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)
6866

6967
try:
7068
# Execute SQL query
@@ -83,7 +81,7 @@ with hotdata.ApiClient(configuration) as api_client:
8381
Name | Type | Description | Notes
8482
------------- | ------------- | ------------- | -------------
8583
**query_request** | [**QueryRequest**](QueryRequest.md)| |
86-
**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]
84+
**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]
8785

8886
### Return type
8987

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

111109
[[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)

docs/QueryRequest.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**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]
1010
**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]
11-
**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]
12-
**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]
11+
**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]
12+
**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]
13+
**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]
1314
**sql** | **str** | |
1415

1516
## Example

docs/SavedQueriesApi.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ void (empty response body)
182182
[[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)
183183

184184
# **execute_saved_query**
185-
> QueryResponse execute_saved_query(id, execute_saved_query_request=execute_saved_query_request)
185+
> QueryResponse execute_saved_query(id, x_database_id, execute_saved_query_request=execute_saved_query_request)
186186
187187
Execute saved query
188188

189-
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.
189+
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.
190190

191191
### Example
192192

@@ -227,11 +227,12 @@ with hotdata.ApiClient(configuration) as api_client:
227227
# Create an instance of the API class
228228
api_instance = hotdata.SavedQueriesApi(api_client)
229229
id = 'id_example' # str | Saved query ID
230+
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.
230231
execute_saved_query_request = hotdata.ExecuteSavedQueryRequest() # ExecuteSavedQueryRequest | Optional version to execute (optional)
231232

232233
try:
233234
# Execute saved query
234-
api_response = api_instance.execute_saved_query(id, execute_saved_query_request=execute_saved_query_request)
235+
api_response = api_instance.execute_saved_query(id, x_database_id, execute_saved_query_request=execute_saved_query_request)
235236
print("The response of SavedQueriesApi->execute_saved_query:\n")
236237
pprint(api_response)
237238
except Exception as e:
@@ -246,6 +247,7 @@ with hotdata.ApiClient(configuration) as api_client:
246247
Name | Type | Description | Notes
247248
------------- | ------------- | ------------- | -------------
248249
**id** | **str**| Saved query ID |
250+
**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. |
249251
**execute_saved_query_request** | [**ExecuteSavedQueryRequest**](ExecuteSavedQueryRequest.md)| Optional version to execute | [optional]
250252

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

271274
[[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)
272275

0 commit comments

Comments
 (0)