Combine DataFolder methods to create/drop tables and table metadata#381
Merged
Combine DataFolder methods to create/drop tables and table metadata#381
Conversation
There was a problem hiding this comment.
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.
skejserjensen
approved these changes
Mar 18, 2026
chrthomsen
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #379 by combining
DataFoldermethods 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 ofDataFolderand 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
DataFolderand the storage crate to make it as simple as possible since the API is currently very complex and hard to follow.