Context
When adding a new spec version, start by updating the crates/ducklake/src/spec folder for the new version.
Afterwards, the remainder of the codebase should be updated s.t. cargo check runs successfully.
Instructions
Follow these steps to add support for a new version of the DuckLake specification in the Rust SDK:
- Extract the version of the new specification to support from the user query. Add the new version as the last element
to the
SUPPORTED_SPEC_VERSIONS. - Find the relevant migrations in the official DuckDB ducklake implementation at
https://raw.githubusercontent.com/duckdb/ducklake/main/src/storage/ducklake_metadata_manager.cpp. The relevant
migration is the one where
ExecuteMigrationis called with the previous latest supported spec version and the new one. - Update all entity definitions in
entities.rsin line with the new specification. This especially includes adding new fields, updating existing ones, and adding new entity types if necessary. Make sure that the order of fields matches the order in the official implementation. - Add a new migration in the
migrations/folder in a new file matching new name of the new version. The implementation of the new migration must be structurally equivalent to the implementation of the existing migrations. Do not add comments just like it is the case for existing migrations. Newly created tables MUST NOT be created withTable::create_entitybut with manualTable::create_entitycalls. Migrations MUST NOT accesscrate::spec::entitiesas this renders migrations useless once the entities are updated. - Update
init.rswith newly available entities and, if necessary, new defaults. Whether the latter is necessary depends on whether the contents ofInitializeDuckLakein https://raw.githubusercontent.com/duckdb/ducklake/main/src/storage/ducklake_metadata_manager.cpp differs from what is currently implemented. - Update the constants in
metadata.rsto match the descriptions and available options in https://raw.githubusercontent.com/duckdb/ducklake/main/src/functions/ducklake_options.cpp. Update the remainder of the codebase to support new options for reading and writing global, schema-level, and table-level metadata. Make sure to skip experimental options.
Afterwards, work on required updates to the rest of the codebase.
Source: borchero/ducklake-sdk — distributed by TomeVault.