Skip to content

Commit 5989242

Browse files
chore: regenerate client from OpenAPI spec (#95)
Co-authored-by: hotdata-automation[bot] <267177015+hotdata-automation[bot]@users.noreply.github.com>
1 parent 53273c4 commit 5989242

10 files changed

Lines changed: 28 additions & 11 deletions

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+
**default_catalog** | **str** | Optional name the database&#39;s auto-created default catalog answers to inside its query scope. Must be a valid SQL identifier (&#x60;[a-z0-9_]&#x60;, not starting with a digit) and may not collide with the system catalogs &#x60;hotdata&#x60;, &#x60;datasets&#x60;, or &#x60;information_schema&#x60;. Defaults to &#x60;default&#x60; when omitted, so &#x60;default.main.&lt;table&gt;&#x60; keeps working. | [optional]
910
**expires_at** | **str** | When this database expires. Accepts either an RFC 3339 timestamp (e.g. &#x60;\&quot;2026-06-01T00:00:00Z\&quot;&#x60;) or a relative duration suffixed with &#x60;h&#x60; (hours), &#x60;m&#x60; (minutes), or &#x60;d&#x60; (days) — for example &#x60;\&quot;24h\&quot;&#x60;, &#x60;\&quot;48h\&quot;&#x60;, or &#x60;\&quot;7d\&quot;&#x60;. Omitted (or empty) means the database never expires. Expiry is best-effort: the database will not be deleted before &#x60;expires_at&#x60;, but cleanup may run later than the exact timestamp. | [optional]
1011
**name** | **str** | Optional free-form display label (for UIs/CLIs). Not unique. Not an identifier — databases are always addressed by &#x60;id&#x60;. Accepts the legacy &#x60;description&#x60; key as an alias so clients that predate the rename keep populating this field. | [optional]
11-
**schemas** | [**List[DatabaseDefaultSchemaDecl]**](DatabaseDefaultSchemaDecl.md) | Optional schemas/tables to declare on the database&#39;s auto-created &#x60;default&#x60; catalog. Mirrors the &#x60;config.schemas&#x60; field of a managed &#x60;POST /v1/connections&#x60;. Tables declared here can be loaded via the standard managed-table load endpoint targeting &#x60;default_connection_id&#x60;. Omitted or empty means the default catalog starts empty. | [optional]
12+
**schemas** | [**List[DatabaseDefaultSchemaDecl]**](DatabaseDefaultSchemaDecl.md) | Optional schemas/tables to declare on the database&#39;s auto-created default catalog. Mirrors the &#x60;config.schemas&#x60; field of a managed &#x60;POST /v1/connections&#x60;. Tables declared here can be loaded via the standard managed-table load endpoint targeting &#x60;default_connection_id&#x60;. Omitted or empty means the default catalog starts empty. | [optional]
1213
**storage_backend** | **str** | Physical storage backend for the database&#39;s auto-created &#x60;default&#x60; catalog. &#x60;\&quot;parquet\&quot;&#x60; (default) uses the versioned parquet cache. &#x60;\&quot;ducklake\&quot;&#x60; stores data in a DuckLake catalog in the shared metadata DB configured via &#x60;ducklake.metadata_pg_url&#x60;, which must be configured for that value to be accepted. Omitted means &#x60;\&quot;parquet\&quot;&#x60;. | [optional]
1314

1415
## Example

docs/CreateDatabaseResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Response body for POST /databases
66

77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
9+
**default_catalog** | **str** | Name the database&#39;s default catalog answers to inside its query scope (&#x60;default&#x60; unless overridden at create time). |
910
**default_connection_id** | **str** | Internal id of the connection that backs this database&#39;s &#x60;default&#x60; catalog. Workspace-level connection endpoints (list, get, health, delete, cache purge) refuse to act on this id — it is exposed only for the managed-tables load endpoint (&#x60;POST /v1/connections/{id}/schemas/{s}/tables/{t}/loads&#x60;) so callers can publish parquet into tables declared at database-create time. Addressing it directly in SQL is not the recommended path — use &#x60;default&#x60; inside an &#x60;X-Database-Id&#x60; scope instead. |
1011
**expires_at** | **datetime** | When this database expires. | [optional]
1112
**id** | **str** | |

docs/DatabaseDetailResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Response body for GET /databases/{database_id}
77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**attachments** | [**List[DatabaseAttachmentInfo]**](DatabaseAttachmentInfo.md) | |
10+
**default_catalog** | **str** | Name the database&#39;s default catalog answers to inside its query scope (&#x60;default&#x60; unless overridden at create time). |
1011
**default_connection_id** | **str** | |
1112
**expires_at** | **datetime** | When this database expires. | [optional]
1213
**id** | **str** | |

docs/DatabaseSummary.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Summary item in GET /databases
66

77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
9+
**default_catalog** | **str** | Name the database&#39;s default catalog answers to inside its query scope. |
910
**expires_at** | **datetime** | | [optional]
1011
**id** | **str** | |
1112
**name** | **str** | | [optional]

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`. 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).
108+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), 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 `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the `hotdata`, `datasets`, or `information_schema` system catalogs. 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

hotdata/api/databases_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def create_database(
360360
) -> CreateDatabaseResponse:
361361
"""Create database
362362
363-
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).
363+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), 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 `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the `hotdata`, `datasets`, or `information_schema` system catalogs. 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).
364364
365365
:param create_database_request: (required)
366366
:type create_database_request: CreateDatabaseRequest
@@ -429,7 +429,7 @@ def create_database_with_http_info(
429429
) -> ApiResponse[CreateDatabaseResponse]:
430430
"""Create database
431431
432-
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).
432+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), 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 `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the `hotdata`, `datasets`, or `information_schema` system catalogs. 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).
433433
434434
:param create_database_request: (required)
435435
:type create_database_request: CreateDatabaseRequest
@@ -498,7 +498,7 @@ def create_database_without_preload_content(
498498
) -> RESTResponseType:
499499
"""Create database
500500
501-
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).
501+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default` (or the optional `default_catalog` name), 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 `default_catalog` overrides the name the default catalog answers to; it must be a valid SQL identifier and may not collide with the `hotdata`, `datasets`, or `information_schema` system catalogs. 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).
502502
503503
:param create_database_request: (required)
504504
:type create_database_request: CreateDatabaseRequest

hotdata/models/create_database_request.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ class CreateDatabaseRequest(BaseModel):
2828
"""
2929
Request body for POST /databases
3030
""" # noqa: E501
31+
default_catalog: Optional[StrictStr] = Field(default=None, description="Optional name the database's auto-created default catalog answers to inside its query scope. Must be a valid SQL identifier (`[a-z0-9_]`, not starting with a digit) and may not collide with the system catalogs `hotdata`, `datasets`, or `information_schema`. Defaults to `default` when omitted, so `default.main.<table>` keeps working.")
3132
expires_at: Optional[StrictStr] = Field(default=None, description="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.")
3233
name: Optional[StrictStr] = Field(default=None, description="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.")
33-
schemas: Optional[List[DatabaseDefaultSchemaDecl]] = Field(default=None, description="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.")
34+
schemas: Optional[List[DatabaseDefaultSchemaDecl]] = Field(default=None, description="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.")
3435
storage_backend: Optional[StrictStr] = Field(default=None, description="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\"`.")
35-
__properties: ClassVar[List[str]] = ["expires_at", "name", "schemas", "storage_backend"]
36+
__properties: ClassVar[List[str]] = ["default_catalog", "expires_at", "name", "schemas", "storage_backend"]
3637

3738
model_config = ConfigDict(
3839
populate_by_name=True,
@@ -80,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]:
8081
if _item_schemas:
8182
_items.append(_item_schemas.to_dict())
8283
_dict['schemas'] = _items
84+
# set to None if default_catalog (nullable) is None
85+
# and model_fields_set contains the field
86+
if self.default_catalog is None and "default_catalog" in self.model_fields_set:
87+
_dict['default_catalog'] = None
88+
8389
# set to None if expires_at (nullable) is None
8490
# and model_fields_set contains the field
8591
if self.expires_at is None and "expires_at" in self.model_fields_set:
@@ -107,6 +113,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107113
return cls.model_validate(obj)
108114

109115
_obj = cls.model_validate({
116+
"default_catalog": obj.get("default_catalog"),
110117
"expires_at": obj.get("expires_at"),
111118
"name": obj.get("name"),
112119
"schemas": [DatabaseDefaultSchemaDecl.from_dict(_item) for _item in obj["schemas"]] if obj.get("schemas") is not None else None,

0 commit comments

Comments
 (0)