@truto/sqlite-builder 2.0.2-canary.20 → 2.0.2-canary.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const results = db.prepare(complexQuery.text).all(...complexQuery.values)
|
|
2
|
+
```
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
status: { in: ['completed', 'shipped'] },
|
|
8
|
-
total: { gt: 50 },
|
|
9
|
-
},
|
|
10
|
-
}
|
|
4
|
+
#### Kitchen Sink Examples
|
|
5
|
+
|
|
6
|
+
Real-world complex filters:
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
WHERE ${compileFilter(userOrderFilter)}
|
|
24
|
-
GROUP BY u.id, u.name, u.email, p.verified_at
|
|
25
|
-
HAVING recent_order_count > 0
|
|
26
|
-
ORDER BY recent_order_total DESC
|
|
27
|
-
`
|
|
8
|
+
```typescript
|
|
9
|
+
// Active users in specific regions, either minors/seniors or VIP
|
|
10
|
+
const complexFilter = {
|
|
11
|
+
and: [
|
|
12
|
+
{ status: 'ACTIVE' },
|
|
13
|
+
{ or: [{ age: { lt: 18 } }, { age: { gte: 65 } }, { membership: 'VIP' }] },
|
|
14
|
+
{ country: { in: ['US', 'CA', 'GB'] } },
|
|
15
|
+
{ email: { exists: true } },
|
|
16
|
+
{ 'profile.verified': true },
|
|
17
|
+
],
|
|
18
|
+
}
|
|
28
19
|
|
|
20
|
+
// Content filtering with multiple criteria
|
|
21
|
+
const contentFilter = {
|
|
22
|
+
name: { like: 'Project%' },
|
|
23
|
+
category: { nin: ['ARCHIVED', 'DELETED', 'SPAM'] },
|
|
24
|
+
created_at: { exists: true },
|
|
25
|
+
or: [
|
|
26
|
+
{ tags: { ilike: '%important%' } },
|
|
27
|
+
{ priority: { gte: 8 } },
|
|
28
|
+
{ 'metadata.featured': true },
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@truto/sqlite-builder","version":"2.0.2-canary.
|
|
1
|
+
{"name":"@truto/sqlite-builder","version":"2.0.2-canary.21","description":"debug canary","license":"MIT","main":"index.js"}
|