본문으로 건너뛰기

타입 별칭: PowerSyncCollectionConfig<TTable, TSchema>

type PowerSyncCollectionConfig<TTable, TSchema> = BasePowerSyncCollectionConfig<TTable, TSchema> & 
| ConfigWithSQLiteTypes
| ConfigWithSQLiteInputType<TTable, TSchema>
| ConfigWithArbitraryCollectionTypes<TTable, TSchema>;

정의 위치: definitions.ts:260

PowerSync 컬렉션을 생성하기 위한 구성 옵션입니다.

타입 매개변수

TTable

TTable extends Table = Table

TSchema

TSchema 확장 StandardSchemaV1&lt;any> = never

예제

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
})
)