diff --git a/src/dialect/mod.rs b/src/dialect/mod.rs index 028aa58a..3747d313 100644 --- a/src/dialect/mod.rs +++ b/src/dialect/mod.rs @@ -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 [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 ` 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 diff --git a/src/dialect/postgresql.rs b/src/dialect/postgresql.rs index a91ab598..011b3a0d 100644 --- a/src/dialect/postgresql.rs +++ b/src/dialect/postgresql.rs @@ -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 + } }