Add dialect flags for NOT VALID and VALIDATE CONSTRAINT

This commit is contained in:
achristmascarl 2025-06-25 12:01:17 -04:00
parent abd80f9ecb
commit aa97b73074
2 changed files with 22 additions and 0 deletions

View file

@ -1060,6 +1060,20 @@ pub trait Dialect: Debug + Any {
fn supports_space_separated_column_options(&self) -> bool {
false
}
/// Returns true if the dialect supports `ADD <table_constraint> [NOT VALID]` in `ALTER TABLE` statements.
///
/// -[PostgreSQL](https://www.postgresql.org/docs/17/sql-altertable.html)
fn supports_constraint_not_validation(&self) -> bool {
false
}
/// Returns true if the dialect supports `VALIDATE CONSTRAINT <constraint_name>` in `ALTER TABLE` statements.
///
/// -[PostgreSQL](https://www.postgresql.org/docs/17/sql-altertable.html)
fn supports_validate_constraint(&self) -> bool {
false
}
}
/// This represents the operators for which precedence must be defined

View file

@ -258,4 +258,12 @@ impl Dialect for PostgreSqlDialect {
fn supports_set_names(&self) -> bool {
true
}
fn supports_constraint_not_validation(&self) -> bool {
true
}
fn supports_validate_constraint(&self) -> bool {
true
}
}