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
@@ -4,29 +4,7 @@ This package (`@powersync/drizzle-driver`) brings the benefits of an ORM through
4
4
5
5
## Beta Release
6
6
7
-
The `drizzle-driver` package is currently in an Beta release.
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.
7
+
This release line targets `drizzle-orm@1.0.0-beta` and the beta `relations` + `db.query` API.
30
8
31
9
## Getting Started
32
10
@@ -35,7 +13,7 @@ Set up the PowerSync Database and wrap it with Drizzle.
import { index, integer, sqliteTable, text } from'drizzle-orm/sqlite-core';
40
18
import { AppSchema } from'./schema';
41
19
@@ -51,52 +29,6 @@ export const todos = sqliteTable('todos', {
51
29
created_at:text('created_at')
52
30
});
53
31
54
-
exportconstlistsRelations=relations(lists, ({ one, many }) => ({
55
-
todos:many(todos)
56
-
}));
57
-
58
-
exportconsttodosRelations=relations(todos, ({ one, many }) => ({
59
-
list:one(lists, {
60
-
fields: [todos.list_id],
61
-
references: [lists.id]
62
-
})
63
-
}));
64
-
65
-
exportconstdrizzleSchema= {
66
-
lists,
67
-
todos,
68
-
listsRelations,
69
-
todosRelations
70
-
};
71
-
72
-
// As an alternative to manually defining a PowerSync schema, generate the local PowerSync schema from the Drizzle schema with the `DrizzleAppSchema` constructor:
73
-
// import { DrizzleAppSchema } from '@powersync/drizzle-driver';
74
-
// export const AppSchema = new DrizzleAppSchema(drizzleSchema);
75
-
//
76
-
// This is optional, but recommended, since you will only need to maintain one schema on the client-side
// As an alternative to manually defining a PowerSync schema, generate the local PowerSync schema from the Drizzle schema with the `DrizzleAppSchema` constructor:
49
+
// import { DrizzleAppSchema } from '@powersync/drizzle-driver';
50
+
// export const AppSchema = new DrizzleAppSchema({ lists, todos });
51
+
//
52
+
// This is optional, but recommended, since you will only need to maintain one schema on the client-side
53
+
// Read on to learn more.
134
54
135
-
exportconstrelations=defineRelations({ lists, todos }, (r) => ({
0 commit comments