DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/powersync-db-collection/type-aliases/PowerSyncCollectionConfig.md
PowerSyncCollectionConfig
ts
type PowerSyncCollectionConfig<TTable, TSchema> = BasePowerSyncCollectionConfig<TTable, TSchema> &
| ConfigWithSQLiteTypes
| ConfigWithSQLiteInputType<TTable, TSchema>
| ConfigWithArbitraryCollectionTypes<TTable, TSchema>;Defined in: definitions.ts:266
Configuration options for creating a PowerSync collection.
Type Parameters#
TTable#
TTable extends Table = Table
TSchema#
TSchema extends StandardSchemaV1<any> = never
Example#
ts
const APP_SCHEMA = new Schema({
documents: new Table({
name: column.text,
}),
})
const db = new PowerSyncDatabase({
database: {
dbFilename: "test.sqlite",
},
schema: APP_SCHEMA,
})
const collection = createCollection(
powerSyncCollectionOptions({
database: db,
table: APP_SCHEMA.props.documents
})
)