Skip to content

Commit

Permalink
feat: mark blocks containing .type() as v5+
Browse files Browse the repository at this point in the history
  • Loading branch information
divarvel committed Jun 8, 2024
1 parent 7b53169 commit cf8c39e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion biscuit-auth/src/datalog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ pub fn get_schema_version(
.any(|query| contains_v4_op(&query.expressions))
});

// null, heterogeneous equals, closures
// null, heterogeneous equals, closures, typeof
if !contains_v5 {
contains_v5 = rules.iter().any(|rule| {
contains_v5_predicate(&rule.head)
Expand Down Expand Up @@ -968,6 +968,7 @@ fn contains_v5_op(expressions: &[Expression]) -> bool {
expression.ops.iter().any(|op| match op {
Op::Value(term) => contains_v5_term(term),
Op::Closure(_, _) => true,
Op::Unary(Unary::TypeOf) => true,
Op::Binary(binary) => matches!(
binary,
Binary::HeterogeneousEqual
Expand Down

0 comments on commit cf8c39e

Please sign in to comment.