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: packages/drizzle-driver/README.md
+128Lines changed: 128 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,28 @@ This package (`@powersync/drizzle-driver`) brings the benefits of an ORM through
6
6
7
7
The `drizzle-driver` package is currently in an Beta release.
8
8
9
+
## Drizzle Version Support
10
+
11
+
-`drizzle-orm@0.44.x`
12
+
- Pass `schema`.
13
+
-`db.query` keeps working as before.
14
+
-`db._query` is available as an alias to the same legacy relational query builder.
15
+
-`drizzle-orm@1.0.0-beta`
16
+
- Pass `relations`.
17
+
- Use `db.query` for relational queries.
18
+
- If you only pass `schema`, the driver exposes a basic `db.query.<table>.findMany()` surface for simple table queries, but relational `with` queries should use `relations`.
19
+
20
+
## Drizzle Version Support
21
+
22
+
-`drizzle-orm@0.44.x`
23
+
- Use `schema`.
24
+
-`db.query` continues to use the legacy relational query builder.
25
+
-`db._query` is available as a compatibility alias to the same legacy query builder.
26
+
-`drizzle-orm@1.0.0-beta`
27
+
- Use `relations` for the new relational query builder and query via `db.query`.
28
+
- Keep using `schema` if you want the legacy relational query builder on `db._query`.
29
+
- If you only pass `schema`, the driver synthesizes a basic `db.query.<table>.findMany()` surface for simple table queries.
30
+
9
31
## Getting Started
10
32
11
33
Set up the PowerSync Database and wrap it with Drizzle.
@@ -67,6 +89,112 @@ export const db = wrapPowerSyncWithDrizzle(powerSyncDb, {
67
89
});
68
90
```
69
91
92
+
### Drizzle v1 beta
93
+
94
+
For Drizzle beta relational queries, pass `relations` and use `db.query`.
The `DrizzleAppSchema` constructor simplifies the process of integrating Drizzle with PowerSync. It infers the local [PowerSync schema](https://docs.powersync.com/installation/client-side-setup/define-your-schema) from your Drizzle schema definition, providing a unified development experience.
0 commit comments