Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- feat(tables): support loading from query results

## [0.6.0] - 2026-07-07

### Changed
Expand Down
16 changes: 8 additions & 8 deletions docs/ConnectionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Method | HTTP request | Description
[**get_connection**](ConnectionsApi.md#get_connection) | **GET** /v1/connections/{connection_id} | Get connection
[**get_table_profile**](ConnectionsApi.md#get_table_profile) | **GET** /v1/connections/{connection_id}/tables/{schema}/{table}/profile | Get table profile
[**list_connections**](ConnectionsApi.md#list_connections) | **GET** /v1/connections | List connections
[**load_managed_table**](ConnectionsApi.md#load_managed_table) | **POST** /v1/connections/{connection_id}/schemas/{schema}/tables/{table}/loads | Load managed table from upload
[**load_managed_table**](ConnectionsApi.md#load_managed_table) | **POST** /v1/connections/{connection_id}/schemas/{schema}/tables/{table}/loads | Load managed table from upload or query result
[**purge_connection_cache**](ConnectionsApi.md#purge_connection_cache) | **DELETE** /v1/connections/{connection_id}/cache | Purge connection cache
[**purge_table_cache**](ConnectionsApi.md#purge_table_cache) | **DELETE** /v1/connections/{connection_id}/tables/{schema}/{table}/cache | Purge table cache

Expand Down Expand Up @@ -808,9 +808,9 @@ This endpoint does not need any parameter.
# **load_managed_table**
> LoadManagedTableResponse load_managed_table(connection_id, var_schema, table, load_managed_table_request)

Load managed table from upload
Load managed table from upload or query result

Publish a previously-uploaded file as the new contents of a managed table. CSV, JSON, and Parquet uploads are supported; the format is auto-detected from the upload's `Content-Type` and file contents, or set explicitly via the `format` field. If the target table (or its schema) has not been declared yet, it is created automatically as part of the load — declaring tables up front is optional. `mode` selects how the upload is applied: `replace` overwrites the table's contents, `append` inserts the uploaded rows on top of the existing data. Concurrent loads against the same upload return 409. Set `async` to run the load in the background and get back a job ID to poll; add `async_after_ms` to wait briefly for it to finish before falling back to a job ID.
Publish data as the new contents of a managed table from one of two sources — provide exactly one. With `upload_id`, a previously-uploaded file is published: CSV, JSON, and Parquet are supported; the format is auto-detected from the upload's `Content-Type` and file contents, or set explicitly via the `format` field. With `result_id`, a persisted query result is copied into the table, so the table keeps its data even after the result expires; a result can be loaded into any number of tables. If the target table (or its schema) has not been declared yet, it is created automatically as part of the load — declaring tables up front is optional. `mode` selects how the data is applied: `replace` overwrites the table's contents, `append` inserts the new rows on top of the existing data. Concurrent loads against the same upload return 409. For an upload, set `async` to run the load in the background and get back a job ID to poll; add `async_after_ms` to wait briefly for it to finish before falling back to a job ID. A `result_id` load runs synchronously.

### Example

Expand Down Expand Up @@ -856,7 +856,7 @@ with hotdata.ApiClient(configuration) as api_client:
load_managed_table_request = hotdata.LoadManagedTableRequest() # LoadManagedTableRequest |

try:
# Load managed table from upload
# Load managed table from upload or query result
api_response = api_instance.load_managed_table(connection_id, var_schema, table, load_managed_table_request)
print("The response of ConnectionsApi->load_managed_table:\n")
pprint(api_response)
Expand Down Expand Up @@ -894,10 +894,10 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Managed table loaded | - |
**202** | Load accepted and running in the background; poll the returned job for status and result | - |
**400** | Invalid request (bad mode, non-managed connection, invalid identifier, bad parquet) | - |
**404** | Connection or upload not found, or the table was deleted | - |
**409** | Upload already consumed or in flight, or the uploaded data changes a column's type incompatibly (only widening to a larger compatible type can be applied automatically); the existing data is unchanged and remains queryable | - |
**202** | Upload load accepted and running in the background; poll the returned job for status and result | - |
**400** | Invalid request (bad mode, both or neither of `upload_id`/`result_id`, `format` combined with `result_id`, non-managed connection, invalid identifier, bad parquet, or the result failed to compute) | - |
**404** | Connection, upload, or result not found, or the table was deleted | - |
**409** | Upload already consumed or in flight, the result is still being computed, or the incoming data changes a column's type incompatibly (only widening to a larger compatible type can be applied automatically); the existing data is unchanged and remains queryable | - |

[[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
1 change: 1 addition & 0 deletions docs/DatabaseDetailResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Response body for GET /databases/{database_id}
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attachments** | [**List[DatabaseAttachmentInfo]**](DatabaseAttachmentInfo.md) | |
**created_at** | **datetime** | When the database was created. | [optional]
**default_catalog** | **str** | Name the database's default catalog answers to inside its query scope (`default` unless overridden at create time). |
**default_connection_id** | **str** | |
**expires_at** | **datetime** | When this database expires. | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/DatabaseSummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Summary item in GET /databases

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**created_at** | **datetime** | When the database was created. | [optional]
**default_catalog** | **str** | Name the database's default catalog answers to inside its query scope. |
**expires_at** | **datetime** | | [optional]
**id** | **str** | |
Expand Down
16 changes: 8 additions & 8 deletions docs/DatabasesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Method | HTTP request | Description
[**detach_database_catalog**](DatabasesApi.md#detach_database_catalog) | **DELETE** /v1/databases/{database_id}/catalogs/{connection_id} | Detach catalog from database
[**get_database**](DatabasesApi.md#get_database) | **GET** /v1/databases/{database_id} | Get database
[**list_databases**](DatabasesApi.md#list_databases) | **GET** /v1/databases | List databases
[**load_database_table**](DatabasesApi.md#load_database_table) | **POST** /v1/databases/{database_id}/schemas/{schema}/tables/{table}/loads | Load database table from upload
[**load_database_table**](DatabasesApi.md#load_database_table) | **POST** /v1/databases/{database_id}/schemas/{schema}/tables/{table}/loads | Load database table from upload or query result


# **add_database_schema**
Expand Down Expand Up @@ -710,9 +710,9 @@ This endpoint does not need any parameter.
# **load_database_table**
> LoadManagedTableResponse load_database_table(database_id, var_schema, table, load_managed_table_request)

Load database table from upload
Load database table from upload or query result

Publish a previously-uploaded file as the new contents of a table on the database's default catalog. The database-scoped equivalent of the connection-scoped managed-table load — addressed by `database_id`, so no `default_connection_id` is needed. CSV, JSON, and Parquet uploads are supported; the format is auto-detected or set via `format`. If the target table (or its schema) has not been declared yet, it is created automatically as part of the load — declaring tables up front is optional. `mode` selects how the upload is applied: `replace` overwrites the table's contents, `append` inserts the uploaded rows on top of the existing data. Concurrent loads against the same upload return 409. Set `async` to run the load in the background and get back a job ID to poll; add `async_after_ms` to wait briefly for it to finish before falling back to a job ID.
Publish data as the new contents of a table on the database's default catalog, from one of two sources — provide exactly one. The database-scoped equivalent of the connection-scoped managed-table load — addressed by `database_id`, so no `default_connection_id` is needed. With `upload_id`, a previously-uploaded file is published: CSV, JSON, and Parquet are supported; the format is auto-detected or set via `format`. With `result_id`, a persisted query result is copied into the table, so the table keeps its data even after the result expires. If the target table (or its schema) has not been declared yet, it is created automatically as part of the load — declaring tables up front is optional. `mode` selects how the data is applied: `replace` overwrites the table's contents, `append` inserts the new rows on top of the existing data. Concurrent loads against the same upload return 409. For an upload, set `async` to run the load in the background and get back a job ID to poll; add `async_after_ms` to wait briefly for it to finish before falling back to a job ID. A `result_id` load runs synchronously.

### Example

Expand Down Expand Up @@ -758,7 +758,7 @@ with hotdata.ApiClient(configuration) as api_client:
load_managed_table_request = hotdata.LoadManagedTableRequest() # LoadManagedTableRequest |

try:
# Load database table from upload
# Load database table from upload or query result
api_response = api_instance.load_database_table(database_id, var_schema, table, load_managed_table_request)
print("The response of DatabasesApi->load_database_table:\n")
pprint(api_response)
Expand Down Expand Up @@ -796,10 +796,10 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Table loaded | - |
**202** | Load accepted and running in the background; poll the returned job for status and result | - |
**400** | Invalid request (bad mode, invalid identifier, bad parquet) | - |
**404** | Database or upload not found, or the table was deleted | - |
**409** | Upload already consumed or in flight, or the uploaded data changes a column's type incompatibly (only widening to a larger compatible type can be applied automatically); the existing data is unchanged and remains queryable | - |
**202** | Upload load accepted and running in the background; poll the returned job for status and result | - |
**400** | Invalid request (bad mode, both or neither of `upload_id`/`result_id`, `format` combined with `result_id`, invalid identifier, bad parquet, or the result failed to compute) | - |
**404** | Database, upload, or result not found, or the table was deleted | - |
**409** | Upload already consumed or in flight, the result is still being computed, or the incoming data changes a column's type incompatibly (only widening to a larger compatible type can be applied automatically); the existing data is unchanged and remains queryable | - |

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

9 changes: 5 additions & 4 deletions docs/LoadManagedTableRequest.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# LoadManagedTableRequest

Request body for the managed-table load endpoints — the connection-scoped `POST /v1/connections/{connection_id}/schemas/{schema}/tables/{table}/loads` and the database-scoped equivalent. Publishes a previously-uploaded file to the named table. CSV and JSON uploads are converted to columnar storage on load; Parquet uploads are published directly. `mode` selects whether the upload replaces the table's contents or is appended on top of them.
Request body for the managed-table load endpoints — the connection-scoped `POST /v1/connections/{connection_id}/schemas/{schema}/tables/{table}/loads` and the database-scoped equivalent. Publishes data to the named table from one of two sources: a previously uploaded file (`upload_id`) or a persisted query result (`result_id`). Provide exactly one. CSV and JSON uploads are converted to columnar storage on load; Parquet uploads and query results are published directly. `mode` selects whether the data replaces the table's contents or is appended on top of them.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**var_async** | **bool** | When true, run the load as a background job and return a job ID to poll instead of blocking until it finishes. Recommended for large uploads, which can take longer than an HTTP request should stay open. | [optional]
**async_after_ms** | **int** | If set (requires `async` = true), wait up to this many milliseconds for the load to finish: if it completes in time the full result is returned (200), otherwise a 202 with a job ID to poll. Must be between 1000 and the server maximum; a value out of that range, or set without `async` = true, is rejected with 400. | [optional]
**format** | **str** | File format of the upload: `\"csv\"`, `\"json\"`, or `\"parquet\"`. Optional — when omitted, the format is auto-detected from the upload's `Content-Type` and, failing that, from the file contents. Provide it explicitly to override detection or when the contents are ambiguous. `\"json\"` expects newline-delimited JSON (one object per line), not a JSON array. | [optional]
**mode** | **str** | How the upload is applied: `\"replace\"` overwrites the table's contents, `\"append\"` inserts the uploaded rows on top of the existing data. |
**upload_id** | **str** | ID of a previously-staged upload (see `POST /v1/files`). The upload is claimed atomically; concurrent loads against the same `upload_id` return 409. |
**format** | **str** | File format of the upload: `\"csv\"`, `\"json\"`, or `\"parquet\"`. Optional — when omitted, the format is auto-detected from the upload's `Content-Type` and, failing that, from the file contents. Provide it explicitly to override detection or when the contents are ambiguous. `\"json\"` expects newline-delimited JSON (one object per line), not a JSON array. Only applies to `upload_id`; query results are always parquet. | [optional]
**mode** | **str** | How the data is applied: `\"replace\"` overwrites the table's contents, `\"append\"` inserts the new rows on top of the existing data. |
**result_id** | **str** | ID of a persisted query result (see `GET /v1/results/{result_id}`) to publish as the table's contents. The result is copied into the table, so the table keeps its data even after the result expires. A result can be loaded into any number of tables. Provide either this or `upload_id`, not both. | [optional]
**upload_id** | **str** | ID of a previously-staged upload (see `POST /v1/files`). The upload is claimed atomically; concurrent loads against the same `upload_id` return 409. Provide either this or `result_id`, not both. | [optional]

## Example

Expand Down
Loading