feat(postgres): support concurrent index creation
This commit is contained in:
1 parent
ebf412b144
commit
aa6d60533c
38 files changed
+1917
-34
No files matched your search
@@ -25,9 +25,16 @@ use comments::build_table_comment_sql;
|
||||
use foreign_keys::build_foreign_key_sql;
|
||||
use indexes::build_index_sql;
|
||||
use triggers::build_trigger_sql;
|
||||
use validation::validate_draft;
|
||||
use validation::{validate_concurrent_index_scope, validate_draft};
|
||||
|
||||
pub fn build_table_structure_change_sql(options: TableStructureSqlOptions) -> TableStructureSqlResult {
|
||||
// Fail closed: an unsupported concurrent-index request (existing index, or
|
||||
// partitioned parent table) must never degrade into blocking index DDL
|
||||
// behind the caller's back, so the whole plan is refused up front.
|
||||
let concurrent_errors = validate_concurrent_index_scope(&options);
|
||||
if !concurrent_errors.is_empty() {
|
||||
return TableStructureSqlResult { statements: Vec::new(), warnings: concurrent_errors };
|
||||
}
|
||||
let mut warnings = validate_draft(&options);
|
||||
let mut statements = build_column_sql(&options, &mut warnings);
|
||||
statements.extend(build_index_sql(&options, &mut warnings));
|
||||
|
||||
Reference in new issue
Block a user