You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/dummy-client.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This guide explains how to use the dummy client effectively.
14
14
The `DummyQueryLeaf` class mimics the real `QueryLeaf` but logs operations instead of executing them:
15
15
16
16
```typescript
17
-
import { DummyQueryLeaf } from'queryleaf';
17
+
import { DummyQueryLeaf } from'@queryleaf/lib';
18
18
19
19
// Create a dummy client (no MongoDB client required)
20
20
const dummyLeaf =newDummyQueryLeaf('mydb');
@@ -30,7 +30,7 @@ await dummyLeaf.execute('SELECT name, email FROM users WHERE age > 21');
30
30
The dummy client is particularly useful for understanding how SQL queries are translated to MongoDB commands:
31
31
32
32
```typescript
33
-
import { DummyQueryLeaf } from'queryleaf';
33
+
import { DummyQueryLeaf } from'@queryleaf/lib';
34
34
35
35
asyncfunction debugSqlTranslation() {
36
36
const dummyLeaf =newDummyQueryLeaf('testdb');
@@ -66,7 +66,7 @@ This will output detailed logs showing how each SQL query is translated to Mongo
66
66
The dummy client is especially useful in unit tests where you want to verify that your application generates the correct SQL queries without actually executing them:
67
67
68
68
```typescript
69
-
import { DummyQueryLeaf } from'queryleaf';
69
+
import { DummyQueryLeaf } from'@queryleaf/lib';
70
70
71
71
// Mock console.log to capture output
72
72
let consoleOutput:string[] = [];
@@ -126,7 +126,7 @@ This means it validates that your SQL syntax is correct and shows how it would b
126
126
You can extend the `DummyQueryLeaf` class for custom testing scenarios:
0 commit comments