Defined in: packages/db/src/local-only.ts:27
Configuration interface for Local-only collection options
Type resolution follows a priority order:
You should provide EITHER an explicit type OR a schema, but not both, as they would conflict.
• TExplicit = unknown
The explicit type of items in the collection (highest priority)
• TSchema extends StandardSchemaV1 = never
The schema type for validation and type inference (second priority)
• TFallback extends Record<string, unknown> = Record<string, unknown>
The fallback type if no explicit or schema type is provided
• TKey extends string | number = string | number
The type of the key returned by getKey
getKey: (item) => TKey;
getKey: (item) => TKey;
Defined in: packages/db/src/local-only.ts:38
ResolveType<TExplicit, TSchema, TFallback>
TKey
optional id: string;
optional id: string;
Defined in: packages/db/src/local-only.ts:36
Standard Collection configuration properties
optional initialData: ResolveType<TExplicit, TSchema, TFallback>[];
optional initialData: ResolveType<TExplicit, TSchema, TFallback>[];
Defined in: packages/db/src/local-only.ts:44
Optional initial data to populate the collection with on creation This data will be applied during the initial sync process
optional onDelete: (params) => Promise<any>;
optional onDelete: (params) => Promise<any>;
Defined in: packages/db/src/local-only.ts:77
Optional asynchronous handler function called after a delete operation
DeleteMutationFnParams<ResolveType<TExplicit, TSchema, TFallback>, TKey, LocalOnlyCollectionUtils>
Object containing transaction and collection information
Promise<any>
Promise resolving to any value
optional onInsert: (params) => Promise<any>;
optional onInsert: (params) => Promise<any>;
Defined in: packages/db/src/local-only.ts:51
Optional asynchronous handler function called after an insert operation
InsertMutationFnParams<ResolveType<TExplicit, TSchema, TFallback>, TKey, LocalOnlyCollectionUtils>
Object containing transaction and collection information
Promise<any>
Promise resolving to any value
optional onUpdate: (params) => Promise<any>;
optional onUpdate: (params) => Promise<any>;
Defined in: packages/db/src/local-only.ts:64
Optional asynchronous handler function called after an update operation
UpdateMutationFnParams<ResolveType<TExplicit, TSchema, TFallback>, TKey, LocalOnlyCollectionUtils>
Object containing transaction and collection information
Promise<any>
Promise resolving to any value
optional schema: TSchema;
optional schema: TSchema;
Defined in: packages/db/src/local-only.ts:37