📄 tanstack/db/latest/docs/reference/powersync-db-collection/type-aliases/ConfigWithArbitraryCollectionTypes

File: ConfigWithArbitraryCollectionTypes.md | Updated: 11/15/2025

Source: https://tanstack.com/db/latest/docs/reference/powersync-db-collection/type-aliases/ConfigWithArbitraryCollectionTypes



TanStack

DB v0v0

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

Latest

Search...

+ K

Menu

Getting Started

Guides

Collections

Frameworks

Community

API Reference

Framework

React logo

React

Version

Latest

Menu

Getting Started

Guides

Collections

Frameworks

Community

API Reference

On this page

ConfigWithArbitraryCollectionTypes

Copy Markdown

Type Alias: ConfigWithArbitraryCollectionTypes<TTable, TSchema>
===============================================================

ts

type ConfigWithArbitraryCollectionTypes<TTable, TSchema> = SerializerConfig<StandardSchemaV1.InferOutput<TSchema>, ExtractedTable<TTable>> & object;


type ConfigWithArbitraryCollectionTypes<TTable, TSchema> = SerializerConfig<StandardSchemaV1.InferOutput<TSchema>, ExtractedTable<TTable>> & object;

Defined in: definitions.ts:125

Config where TInput and TOutput have arbitrarily typed values. The keys of the types need to equal the SQLite types. Since TInput is not the SQLite types, we require a schema in order to deserialize incoming SQLite updates. The schema should validate from SQLite to TOutput.

Type Declaration
----------------
### deserializationSchema

ts

deserializationSchema: StandardSchemaV1<ExtractedTable<TTable>, StandardSchemaV1.InferOutput<TSchema>>;


deserializationSchema: StandardSchemaV1<ExtractedTable<TTable>, StandardSchemaV1.InferOutput<TSchema>>;

Schema for deserializing and validating input data from the sync stream.

This schema defines how to transform and validate data coming from SQLite types (as stored in the database) into the desired output types (TOutput) expected by your application or validation logic.

The generic parameters allow for arbitrary input and output types, so you can specify custom conversion rules for each column. This is especially useful when your application expects richer types (e.g., Date, enums, objects) than what SQLite natively supports.

Use this to ensure that incoming data from the sync stream is properly converted and validated before use.

Example:

typescript

deserializationSchema: z.object({
  createdAt: z.preprocess((val) => new Date(val as string), z.date()),
  meta: z.preprocess((val) => JSON.parse(val as string), z.object({ ... })),
})


deserializationSchema: z.object({
  createdAt: z.preprocess((val) => new Date(val as string), z.date()),
  meta: z.preprocess((val) => JSON.parse(val as string), z.object({ ... })),
})

This enables robust type safety and validation for incoming data, bridging the gap between SQLite storage and your application's expected types.

### schema

ts

schema: TSchema;


schema: TSchema;

Type Parameters
---------------
### TTable

TTable extends Table

### TSchema

TSchema extends StandardSchemaV1<AnyTableColumnType<TTable>, AnyTableColumnType<TTable>>

Edit on GitHub

Home

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

scarf analytics