pub struct NamedDatabaseConfig {
pub name: String,
pub database: DatabaseConfig,
pub migrations: MigrationSettings,
pub hooks: HooksConfig,
pub placeholders: HashMap<String, String>,
pub depends_on: Vec<String>,
}Expand description
Configuration for a single named database within a multi-db setup.
Fields§
§name: StringUnique logical name identifying this database.
database: DatabaseConfigDatabase connection configuration.
migrations: MigrationSettingsMigration settings for this database.
hooks: HooksConfigHook configuration for this database.
placeholders: HashMap<String, String>Placeholder key-value pairs for SQL template substitution.
depends_on: Vec<String>Names of other databases that must be migrated before this one.
Implementations§
Source§impl NamedDatabaseConfig
impl NamedDatabaseConfig
Sourcepub fn to_waypoint_config(&self) -> WaypointConfig
pub fn to_waypoint_config(&self) -> WaypointConfig
Convert to a standalone WaypointConfig for running commands.
Everything not declared per-database falls back to built-in defaults.
Prefer Self::to_waypoint_config_inheriting, which carries the
top-level [safety], [preflight], [guards], [reversals],
[advisor], [snapshots], [lint] and [simulation] sections over
instead of silently dropping them.
Sourcepub fn to_waypoint_config_inheriting(
&self,
parent: &WaypointConfig,
) -> WaypointConfig
pub fn to_waypoint_config_inheriting( &self, parent: &WaypointConfig, ) -> WaypointConfig
Convert to a standalone WaypointConfig, inheriting the global
sections from parent.
A [[databases]] entry only carries connection, migration, hook and
placeholder settings. Every other section is process-wide policy — a
[safety] block_on_danger = true must not stop applying just because
the run happens to be multi-database.
Trait Implementations§
Source§impl Clone for NamedDatabaseConfig
impl Clone for NamedDatabaseConfig
Source§fn clone(&self) -> NamedDatabaseConfig
fn clone(&self) -> NamedDatabaseConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more