|
1 | 1 | import { describe, expect, test } from "vitest" |
2 | 2 | import { D2, MultiSet, output } from "@electric-sql/d2mini" |
3 | 3 | import { compileQuery } from "../../../src/query/compiler/index.js" |
4 | | -import { CollectionRef, Func, Ref, Value } from "../../../src/query/ir.js" |
| 4 | +import { CollectionRef, Func, PropRef, Value } from "../../../src/query/ir.js" |
5 | 5 | import type { QueryIR } from "../../../src/query/ir.js" |
6 | 6 | import type { CollectionImpl } from "../../../src/collection.js" |
7 | 7 |
|
@@ -82,9 +82,9 @@ describe(`Query2 Compiler`, () => { |
82 | 82 | const query: QueryIR = { |
83 | 83 | from: new CollectionRef(usersCollection, `users`), |
84 | 84 | select: { |
85 | | - id: new Ref([`users`, `id`]), |
86 | | - name: new Ref([`users`, `name`]), |
87 | | - age: new Ref([`users`, `age`]), |
| 85 | + id: new PropRef([`users`, `id`]), |
| 86 | + name: new PropRef([`users`, `name`]), |
| 87 | + age: new PropRef([`users`, `age`]), |
88 | 88 | }, |
89 | 89 | } |
90 | 90 |
|
@@ -150,11 +150,11 @@ describe(`Query2 Compiler`, () => { |
150 | 150 | const query: QueryIR = { |
151 | 151 | from: new CollectionRef(usersCollection, `users`), |
152 | 152 | select: { |
153 | | - id: new Ref([`users`, `id`]), |
154 | | - name: new Ref([`users`, `name`]), |
155 | | - age: new Ref([`users`, `age`]), |
| 153 | + id: new PropRef([`users`, `id`]), |
| 154 | + name: new PropRef([`users`, `name`]), |
| 155 | + age: new PropRef([`users`, `age`]), |
156 | 156 | }, |
157 | | - where: [new Func(`gt`, [new Ref([`users`, `age`]), new Value(20)])], |
| 157 | + where: [new Func(`gt`, [new PropRef([`users`, `age`]), new Value(20)])], |
158 | 158 | } |
159 | 159 |
|
160 | 160 | const graph = new D2() |
@@ -203,13 +203,13 @@ describe(`Query2 Compiler`, () => { |
203 | 203 | const query: QueryIR = { |
204 | 204 | from: new CollectionRef(usersCollection, `users`), |
205 | 205 | select: { |
206 | | - id: new Ref([`users`, `id`]), |
207 | | - name: new Ref([`users`, `name`]), |
| 206 | + id: new PropRef([`users`, `id`]), |
| 207 | + name: new PropRef([`users`, `name`]), |
208 | 208 | }, |
209 | 209 | where: [ |
210 | 210 | new Func(`and`, [ |
211 | | - new Func(`gt`, [new Ref([`users`, `age`]), new Value(20)]), |
212 | | - new Func(`eq`, [new Ref([`users`, `active`]), new Value(true)]), |
| 211 | + new Func(`gt`, [new PropRef([`users`, `age`]), new Value(20)]), |
| 212 | + new Func(`eq`, [new PropRef([`users`, `active`]), new Value(true)]), |
213 | 213 | ]), |
214 | 214 | ], |
215 | 215 | } |
|
0 commit comments