Save the configuration to a TOML configuration file#369
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements configuration persistence for ModelarDB-RS by introducing a TOML-based configuration file (modelardb.toml) stored in the root of the local data folder. The configuration is now loaded from this file on server startup and automatically updated when changes are made through the UpdateConfiguration action, providing a persistent state across server restarts.
Key Changes:
- Configuration is now persisted to a
modelardb.tomlfile that is created on first server startup - Configuration updates via the
UpdateConfigurationaction are saved to disk - Configuration structure refactored to separate serializable data from runtime state
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
docs/user/README.md |
Documents the new modelardb.toml configuration file and its behavior |
Cargo.toml |
Adds toml and serde dependencies for configuration serialization |
Cargo.lock |
Updates lock file with new TOML-related dependencies (toml 0.9.8) |
crates/modelardb_server/Cargo.toml |
Adds toml and serde workspace dependencies to server crate |
crates/modelardb_server/src/error.rs |
Adds error variants for TOML serialization/deserialization failures |
crates/modelardb_server/src/context.rs |
Updates context initialization to use async try_new for configuration manager |
crates/modelardb_server/src/storage/mod.rs |
Changes direct field access to getter methods for thread configuration |
crates/modelardb_server/src/remote.rs |
Updates documentation and error handling for UpdateConfiguration action |
crates/modelardb_server/src/configuration.rs |
Core implementation: splits Configuration struct for serialization, implements file I/O, adds validation, updates all setters to persist changes, and includes comprehensive tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chrthomsen
requested changes
Dec 10, 2025
chrthomsen
approved these changes
Dec 10, 2025
skejserjensen
approved these changes
Dec 10, 2025
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.
Closes #368 by updating the configuration manager so it now persists the configuration to a
modelardb.tomlconfiguration file in the root of the local data folder. This file is updated when changes are made to the configuration using theUpdateConfigurationaction. If the file is changed manually, the changes are first applied when the server is restarted.