tanstack-db-pglite 1.0.1 → 1.0.2

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/dist/drizzle.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare function drizzleCollectionOptions<Table extends PgTable, SyncPara
10
10
  onDelete?: (params: DeleteMutationFnParams<Table['$inferSelect'], string>) => Promise<void>;
11
11
  startSync?: boolean;
12
12
  prepare?: () => Promise<unknown> | unknown;
13
- sync: (params: Pick<SyncParams, 'write' | 'collection'>) => Promise<void>;
13
+ sync?: (params: Pick<SyncParams, 'write' | 'collection'>) => Promise<void>;
14
14
  }): CollectionConfig<Table['$inferSelect'], string> & {
15
15
  utils: {
16
16
  runSync: () => Promise<void>;
package/dist/drizzle.js CHANGED
@@ -98,6 +98,9 @@ export function drizzleCollectionOptions({ startSync = true, ...config }) {
98
98
  },
99
99
  utils: {
100
100
  runSync: async () => {
101
+ if (!config.sync) {
102
+ throw new Error('Sync is not defined');
103
+ }
101
104
  const params = await getSyncParams();
102
105
  // To wait the first sync
103
106
  await params.collection.stateWhenReady();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tanstack-db-pglite",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "packageManager": "pnpm@10.16.1",
5
5
  "description": "",
6
6
  "author": "Valerii Strilets",