Skip to content

JS config

await Barq.open({
path: 'app.barq',
schema: [Task],
schemaVersion: 1,
});
Option Meaning
path Database file path.
schema Object schemas. Required when first creating a file.
schemaVersion Local schema version.
inMemory Open as in-memory database. Not compatible with sync.
readOnly Open without writes.
encryptionKey 64-byte local file encryption key.
onMigration Local migration callback. Not compatible with sync.
shouldCompact Decide whether to compact before open.
sync Sync configuration.
await Barq.open({
schema: [Task],
sync: {
user,
flexible: true,
},
});

Use either flexible: true or partitionValue, not both.