Skip to content

Commit

Permalink
Fix SeaQL#830, remove incorrect restriction on recursive CTE
Browse files Browse the repository at this point in the history
I tested this with sqlite and the queries execute successfully. It's
possible that there are other incorrect behaviors that can be
pre-emptively caught, perhaps those could be added in a new PR later.
  • Loading branch information
Andrew Baxter committed Nov 8, 2024
1 parent b91ba14 commit 3dac32c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/backend/query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,15 +777,6 @@ pub trait QueryBuilder:
"Cannot build a with query that has no common table expression!"
);

if with_clause.recursive {
assert_eq!(
with_clause.cte_expressions.len(),
1,
"Cannot build a recursive query with more than one common table! \
A recursive with query must have a single cte inside it that has a union query of \
two queries!"
);
}
for cte in &with_clause.cte_expressions {
if !cte_first {
write!(sql, ", ").unwrap();
Expand Down

0 comments on commit 3dac32c

Please sign in to comment.