Skip to content

Commit 31759b7

Browse files
committed
Tweak
1 parent b3882ac commit 31759b7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/drizzle-driver/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { wrapPowerSyncWithDrizzle } from '@powersync/drizzle-driver';
1515
import { PowerSyncDatabase } from '@powersync/web';
1616
import { relations } from 'drizzle-orm';
1717
import { index, integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';
18-
import { appSchema } from './schema';
18+
import { AppSchema } from './schema';
1919

2020
export const lists = sqliteTable('lists', {
2121
id: text('id'),
@@ -47,22 +47,24 @@ export const drizzleSchema = {
4747
todosRelations
4848
};
4949

50+
// As an alternative to manually defining a PowerSync schema, generate the local PowerSync schema from the Drizzle schema with `toPowerSyncSchema`:
51+
// import { toPowerSyncSchema } from '@powersync/drizzle-driver';
52+
// export const AppSchema = toPowerSyncSchema(drizzleSchema);
53+
//
54+
// This is optional, but recommended, since you will only need to maintain one schema on the client-side
55+
// Read on to learn more.
56+
5057
export const powerSyncDb = new PowerSyncDatabase({
5158
database: {
5259
dbFilename: 'test.sqlite'
5360
},
54-
schema: appSchema
61+
schema: AppSchema
5562
});
5663

5764
// This is the DB you will use in queries
5865
export const db = wrapPowerSyncWithDrizzle(powerSyncDb, {
5966
schema: drizzleSchema
6067
});
61-
62-
// Generate the local PowerSync schema from the Drizzle schema with `toPowerSyncSchema`
63-
// Optional, but recommended, since you will only need to maintain one schema on the client-side
64-
// Read on to learn more.
65-
export const AppSchema = toPowerSyncSchema(drizzleSchema);
6668
```
6769

6870
## Schema Conversion

0 commit comments

Comments
 (0)