Skip to content

Commit b7f1af9

Browse files
authored
ENG-1122 use or-join-clause so the variables are exposed to the optimizer (#584)
1 parent 860febc commit b7f1af9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/roam/src/utils/conditionToDatalog.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ const translator: Record<string, Translator> = {
446446
if (currentUserMatch) {
447447
return [
448448
{
449-
type: "or-clause",
449+
type: "or-join-clause",
450450
clauses: [
451451
{
452452
type: "data-pattern",
@@ -465,6 +465,7 @@ const translator: Record<string, Translator> = {
465465
],
466466
},
467467
],
468+
variables: [{ type: "variable", value: `${source}-String` }],
468469
},
469470
{
470471
type: "pred-expr",
@@ -481,7 +482,7 @@ const translator: Record<string, Translator> = {
481482
const rePattern = regexRePatternValue(target);
482483
return [
483484
{
484-
type: "or-clause",
485+
type: "or-join-clause",
485486
clauses: [
486487
{
487488
type: "data-pattern",
@@ -500,6 +501,7 @@ const translator: Record<string, Translator> = {
500501
],
501502
},
502503
],
504+
variables: [{ type: "variable", value: `${source}-String` }],
503505
},
504506
{
505507
type: "fn-expr",
@@ -528,7 +530,7 @@ const translator: Record<string, Translator> = {
528530

529531
return [
530532
{
531-
type: "or-clause",
533+
type: "or-join-clause",
532534
clauses: [
533535
{
534536
type: "data-pattern",
@@ -547,6 +549,7 @@ const translator: Record<string, Translator> = {
547549
],
548550
},
549551
],
552+
variables: [{ type: "variable", value: `${source}-String` }],
550553
},
551554
{
552555
type: "pred-expr",

0 commit comments

Comments
 (0)