Skip to content

Combine DataFolder methods to create/drop tables and table metadata#381

Merged
CGodiksen merged 16 commits intomainfrom
dev/combine-create-drop
Mar 19, 2026
Merged

Combine DataFolder methods to create/drop tables and table metadata#381
CGodiksen merged 16 commits intomainfrom
dev/combine-create-drop

Conversation

@CGodiksen
Copy link
Copy Markdown
Collaborator

This PR closes #379 by combining DataFolder methods to create/drop tables and table metadata so we instead have a single method that creates and saves a normal table with metadata, and a single method that creates and saves a time series table with metadata. Similarly, we now also have a single method to drop tables and table metadata. This should clean up the public API of DataFolder and make sure that we, for example, do not forget to save metadata when creating a Delta table.

The PR also includes other minor changes to the public API of DataFolder and the storage crate to make it as simple as possible since the API is currently very complex and hard to follow.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the DataFolder public API by combining Delta table creation/deletion with the corresponding metadata persistence/removal, reducing the risk of callers forgetting to update metadata tables.

Changes:

  • Combine create-table + save-metadata flows for normal and time series tables.
  • Combine drop-table + drop-metadata flow into a single drop_table() call.
  • Refactor metadata table registration to be handled via DataFolder::create_and_register_metadata_table() and update call sites/tests accordingly.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/modelardb_storage/src/lib.rs Removes the standalone metadata-table registration helper from the crate API surface.
crates/modelardb_storage/src/data_folder/mod.rs Implements combined create/drop behavior, introduces create_and_register_metadata_table(), and updates tests/helpers.
crates/modelardb_storage/src/data_folder/cluster.rs Switches cluster metadata table setup to the new create_and_register_metadata_table() API.
crates/modelardb_server/src/storage/uncompressed_data_manager.rs Updates tests to use the new combined time series table creation API.
crates/modelardb_server/src/storage/data_transfer.rs Updates test setup to rely on combined create-and-persist behavior.
crates/modelardb_server/src/storage/compressed_data_manager.rs Updates tests to rely on fixture-created tables and the new creation semantics.
crates/modelardb_server/src/context.rs Removes explicit metadata persistence/removal calls now handled inside DataFolder methods.
crates/modelardb_server/src/cluster.rs Removes explicit metadata persistence/removal calls now handled inside DataFolder methods.
crates/modelardb_embedded/src/operations/data_folder.rs Removes explicit metadata persistence/removal calls now handled inside DataFolder methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CGodiksen CGodiksen requested a review from chrthomsen March 18, 2026 16:18
@CGodiksen CGodiksen merged commit c3d0aee into main Mar 19, 2026
6 of 9 checks passed
@CGodiksen CGodiksen deleted the dev/combine-create-drop branch March 19, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combine DataFolder methods to create/drop tables and table metadata

4 participants