Skip to content

Commit 17cbba9

Browse files
committed
refactor: clean up exclusion constraint additions for upstream review
1 parent 6f47488 commit 17cbba9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/ast/table_constraints.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,12 @@ impl fmt::Display for ExclusionElement {
638638
}
639639
}
640640

641+
impl crate::ast::Spanned for ExclusionElement {
642+
fn span(&self) -> Span {
643+
self.expr.span()
644+
}
645+
}
646+
641647
/// A PostgreSQL `EXCLUDE` constraint.
642648
///
643649
/// `[ CONSTRAINT <name> ] EXCLUDE [ USING <index_method> ] ( <element> WITH <operator> [, ...] ) [ INCLUDE (<cols>) ] [ WHERE (<predicate>) ]`
@@ -693,6 +699,7 @@ impl crate::ast::Spanned for ExclusionConstraint {
693699
.iter()
694700
.map(|i| i.span)
695701
.chain(self.index_method.iter().map(|i| i.span))
702+
.chain(self.elements.iter().map(|e| e.span()))
696703
.chain(self.include.iter().map(|i| i.span))
697704
.chain(self.where_clause.iter().map(|e| e.span()))
698705
.chain(self.characteristics.iter().map(|c| c.span())),

0 commit comments

Comments
 (0)