You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(databases): add fork subcommand
Add `hotdata databases fork [DATABASE]` wrapping the
`POST /v1/databases/{id}/fork` API: create an independent deep copy of a
managed database — same schemas, tables, and data, diverging freely
afterwards.
- Source positional defaults to the current database; resolves by id,
catalog, or name like `attach`/`detach`.
- `--name` defaults to `<source>-fork` so the fork and source stay
distinguishable in `databases list` (an unnamed fork otherwise inherits
both the source's display name and catalog alias).
- `--expires-at` accepts a relative duration or RFC 3339 timestamp; when
omitted a still-future source expiry is inherited, so the resolved
expiry is always printed ("never" when none).
- Sets the fork as the current database on success; source is unchanged.
- Routes through the raw `post_raw` seam (the endpoint is excluded from
the public SDK); surfaces the API error body, with a recovery hint on
the pre-DuckLake (parquet-backed) 400.
Validated end-to-end against production and fuzzed (malformed expiry,
hostile names, hostile source ids); no crashes or orphaned databases.
* docs(skills): document databases fork command
* feat(databases): use typed SDK fork handle; bump hotdata to 0.9.1
The fork endpoint is now public and generated into the SDK, so the CLI
calls it through the same ergonomic `databases()` handle as
create/get/list/delete instead of the raw `post_raw` seam:
api.client().databases().fork(&db.id, ForkDatabaseRequest { .. })
- fork_database_request now builds the typed ForkDatabaseRequest (double
-option fields) rather than raw JSON; behaviour (default name to
`<source>-fork`, omit fields to inherit) is unchanged.
- fork_error_exit preserves the verbatim API error plus the parquet
-backed-source recovery hint, now driven off the mapped ApiError.
- Bump hotdata 0.8.1 -> 0.9.1 (adds fork + ergonomic wrapper).
The bump also pulls in the `default_schema` field now required on the
database detail/summary/create SDK models, so the affected test fixtures
in databases.rs and indexes.rs gain it.
---------
Co-authored-by: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com>
-`list` — all managed databases in the workspace. Active database is marked with `*` under the DEFAULT column; CREATED shows when each database was made.
117
118
-`create` — creates a new managed database. `--name` is an optional human-readable display name. `--catalog` sets the SQL alias used in queries (`SELECT … FROM <catalog>.schema.table`); must be `[a-z_][a-z0-9_]*`. `--expires-at` accepts relative durations (`24h`, `7d`, `90m`) or an RFC 3339 timestamp; omitting means no expiry. Repeat `--table` to declare tables up front.
119
+
-`fork` — creates a new managed database that is an independent deep copy of an existing one (same schemas, tables, and data); the source is left unchanged and the two diverge freely afterwards. The source defaults to the active database; pass `<id_or_name>` (id, catalog, or name) to fork another. `--name` defaults to `<source>-fork` (so the two stay distinguishable in `list`); `--expires-at` accepts a relative duration or RFC 3339 timestamp, and when omitted a still-future source expiry is carried over. The fork becomes the active database on success. The fork answers to the **same catalog alias** as its source inside its own scope; indexes are **not** carried over. Only databases created with the current (DuckLake) storage engine can be forked — older parquet-backed databases return an error.
118
120
-`set` — saves `<id_or_name>` as the active database. Subsequent `databases tables` and `context` commands use it automatically.
119
121
-`unset` — clears the active database from config.
120
122
-`<id_or_name>` — inspect one database (id, catalog, name, expires_at).
r#"{"error":{"code":"BAD_REQUEST","message":"forking a database is only supported for DuckLake-backed catalogs; source database 'db_old' uses storage backend 'parquet'"}}"#,
2481
+
)
2482
+
.create();
2483
+
2484
+
let api = Api::test_new(&server.url(),"k",Some("ws1"));
0 commit comments