feat(schema-diff): select fields and indexes for synchronization
This commit is contained in:
1 parent
d8bc5153d2
commit
726f86e24c
32 files changed
+1185
-413
No files matched your search
@@ -32,3 +32,33 @@ pub fn generate_schema_sync_sql(
|
||||
&field_mappings.unwrap_or_default(),
|
||||
))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn generate_schema_sync_plan(
|
||||
diffs: Vec<dbx_core::schema_diff::TableDiff>,
|
||||
function_diffs: Option<Vec<dbx_core::schema_diff::FunctionDiff>>,
|
||||
sequence_diffs: Option<Vec<dbx_core::schema_diff::SequenceDiff>>,
|
||||
rule_diffs: Option<Vec<dbx_core::schema_diff::RuleDiff>>,
|
||||
owner_diffs: Option<Vec<dbx_core::schema_diff::OwnerDiff>>,
|
||||
database_type: dbx_core::models::connection::DatabaseType,
|
||||
target_schema: Option<String>,
|
||||
cascade_delete: Option<bool>,
|
||||
source_dialect: Option<dbx_core::sql_dialect::descriptor::DialectKind>,
|
||||
field_mappings: Option<Vec<dbx_core::schema_diff::FieldMapping>>,
|
||||
enable_rollback: Option<bool>,
|
||||
) -> Result<dbx_core::schema_diff::SchemaSyncSqlPlan, String> {
|
||||
Ok(dbx_core::schema_diff::generate_schema_sync_sql_plan(
|
||||
&diffs,
|
||||
function_diffs.as_deref().unwrap_or_default(),
|
||||
sequence_diffs.as_deref().unwrap_or_default(),
|
||||
rule_diffs.as_deref().unwrap_or_default(),
|
||||
owner_diffs.as_deref().unwrap_or_default(),
|
||||
database_type,
|
||||
target_schema.as_deref(),
|
||||
cascade_delete.unwrap_or(false),
|
||||
source_dialect,
|
||||
&field_mappings.unwrap_or_default(),
|
||||
enable_rollback.unwrap_or(false),
|
||||
))
|
||||
}
|
||||
@@ -1696,6 +1696,7 @@ pub fn run() {
|
||||
commands::schema::list_available_extensions,
|
||||
commands::schema_diff::prepare_schema_diff,
|
||||
commands::schema_diff::generate_schema_sync_sql,
|
||||
commands::schema_diff::generate_schema_sync_plan,
|
||||
commands::dialect_cmd::list_dialect_data_types,
|
||||
commands::schema_cache::save_schema_cache,
|
||||
commands::schema_cache::load_schema_cache,
|
||||
|
||||
Reference in new issue
Block a user