type SerializerConfig<TOutput, TSQLite> = object;
type SerializerConfig<TOutput, TSQLite> = object;
Defined in: definitions.ts:61
TOutput extends Record<string, unknown>
TSQLite extends Record<string, unknown>
onDeserializationError: (error) => void;
onDeserializationError: (error) => void;
Defined in: definitions.ts:94
Application logic should ensure that incoming synced data is always valid. Failing to deserialize and apply incoming changes results in data inconsistency - which is a fatal error. Use this callback to react to deserialization errors.
StandardSchemaV1.FailureResult
void
optional serializer: CustomSQLiteSerializer<TOutput, TSQLite>;
optional serializer: CustomSQLiteSerializer<TOutput, TSQLite>;
Defined in: definitions.ts:87
Optional partial serializer object for customizing how individual columns are serialized for SQLite.
This should be a partial map of column keys to serialization functions, following the CustomSQLiteSerializer type. Each function receives the column value and returns a value compatible with SQLite storage.
If not provided for a column, the default behavior is used:
Use this option to override serialization for specific columns, such as formatting dates, handling enums, or serializing complex objects.
Example:
serializer: {
createdAt: (date) => date.getTime(), // Store as timestamp
meta: (meta) => JSON.stringify(meta), // Custom object serialization
}
serializer: {
createdAt: (date) => date.getTime(), // Store as timestamp
meta: (meta) => JSON.stringify(meta), // Custom object serialization
}
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.
