tanstack-db-pglite 1.1.2 → 1.1.3

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
@@ -1,8 +1,9 @@
1
1
  import type { CollectionConfig, DeleteMutationFnParams, InsertMutationFnParams, SyncConfig, UpdateMutationFnParams } from '@tanstack/db';
2
2
  import type { IndexColumn, PgTable } from 'drizzle-orm/pg-core';
3
3
  import type { PgliteDatabase } from 'drizzle-orm/pglite';
4
- import type { CreateSelectSchema } from 'drizzle-zod';
4
+ import type { BuildSchema } from 'drizzle-zod';
5
5
  type SyncParams<Table extends PgTable> = Parameters<SyncConfig<Table['$inferSelect'], string>['sync']>[0];
6
+ type Schema<Table extends PgTable> = BuildSchema<'select', Table['_']['columns'], undefined, true>;
6
7
  export declare function drizzleCollectionOptions<Table extends PgTable>({ startSync, ...config }: {
7
8
  db: PgliteDatabase<any>;
8
9
  table: Table;
@@ -13,9 +14,9 @@ export declare function drizzleCollectionOptions<Table extends PgTable>({ startS
13
14
  startSync?: boolean;
14
15
  prepare?: () => Promise<unknown> | unknown;
15
16
  sync?: (params: Pick<SyncParams<Table>, 'write' | 'collection'>) => Promise<void>;
16
- }): CollectionConfig<Table['$inferSelect'], string, ReturnType<CreateSelectSchema<Table['$inferSelect']>>, {
17
+ }): CollectionConfig<Table['$inferSelect'], string, Schema<Table>, {
17
18
  runSync: () => Promise<void>;
18
19
  }> & {
19
- schema: ReturnType<CreateSelectSchema<Table['$inferSelect']>>;
20
+ schema: Schema<Table>;
20
21
  };
21
22
  export {};
package/dist/drizzle.js CHANGED
@@ -112,7 +112,6 @@ export function drizzleCollectionOptions({ startSync = true, ...config }) {
112
112
  },
113
113
  },
114
114
  gcTime: 0,
115
- // @ts-expect-error wrong types
116
115
  schema: createSelectSchema(config.table),
117
116
  getKey: t => t[config.primaryColumn.name],
118
117
  onInsert: async (params) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tanstack-db-pglite",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "packageManager": "pnpm@10.32.1",
5
5
  "description": "",
6
6
  "author": "Valerii Strilets",