SqliteBucketStorage
Extends
Implements
Constructors
new SqliteBucketStorage()
new SqliteBucketStorage(
db,
mutex,
logger?): SqliteBucketStorage
Parameters
Parameter | Type |
---|---|
db | DBAdapter |
mutex | Mutex |
logger ? | ILogger |
Returns
Overrides
Properties
Property | Type |
---|---|
tableNames | Set <string > |
Methods
_getClientId()
_getClientId(): Promise<string>
Returns
Promise
<string
>
autoCompact()
autoCompact(): Promise<void>
Exposed for tests only.
Returns
Promise
<void
>
Implementation of
BucketStorageAdapter
.autoCompact
dispose()
dispose(): Promise<void>
Returns
Promise
<void
>
Implementation of
BucketStorageAdapter
.dispose
forceCompact()
forceCompact(): Promise<void>
Force a compact, for tests.
Returns
Promise
<void
>
Implementation of
BucketStorageAdapter
.forceCompact
getBucketStates()
getBucketStates(): Promise<BucketState[]>
Returns
Promise
<BucketState
[]>
Implementation of
BucketStorageAdapter
.getBucketStates
getClientId()
getClientId(): Promise<string>
Get an unique client id.
Returns
Promise
<string
>
Implementation of
BucketStorageAdapter
.getClientId
getCrudBatch()
getCrudBatch(limit?): Promise<null | CrudBatch>
Get a batch of objects to send to the server. When the objects are successfully sent to the server, call .complete()
Parameters
Parameter | Type |
---|---|
limit ? | number |
Returns
Promise
<null
| CrudBatch
>
Implementation of
BucketStorageAdapter
.getCrudBatch
getMaxOpId()
getMaxOpId(): string
Returns
string
Implementation of
BucketStorageAdapter
.getMaxOpId
hasCompletedSync()
hasCompletedSync(): Promise<boolean>
Returns
Promise
<boolean
>
Implementation of
BucketStorageAdapter
.hasCompletedSync
hasCrud()
hasCrud(): Promise<boolean>
Returns
Promise
<boolean
>
Implementation of
init()
init(): Promise<void>
Returns
Promise
<void
>
Implementation of
iterateAsyncListeners()
iterateAsyncListeners(cb): Promise<void>
Parameters
Parameter | Type |
---|---|
cb | (listener ) => Promise <any > |
Returns
Promise
<void
>
Implementation of
BucketStorageAdapter
.iterateAsyncListeners
Inherited from
BaseObserver
.iterateAsyncListeners
iterateListeners()
iterateListeners(cb): void
Parameters
Parameter | Type |
---|---|
cb | (listener ) => any |
Returns
void
Implementation of
BucketStorageAdapter
.iterateListeners
Inherited from
nextCrudItem()
nextCrudItem(): Promise<undefined | CrudEntry>
Returns
Promise
<undefined
| CrudEntry
>
Implementation of
BucketStorageAdapter
.nextCrudItem
registerListener()
registerListener(listener): () => void
Register a listener for updates to the PowerSync client.
Parameters
Parameter | Type |
---|---|
listener | Partial <BucketStorageListener > |
Returns
Function
Returns
void
Implementation of
BucketStorageAdapter
.registerListener
Inherited from
removeBuckets()
removeBuckets(buckets): Promise<void>
Parameters
Parameter | Type |
---|---|
buckets | string [] |
Returns
Promise
<void
>
Implementation of
BucketStorageAdapter
.removeBuckets
saveSyncData()
saveSyncData(batch): Promise<void>
Parameters
Parameter | Type |
---|---|
batch | SyncDataBatch |
Returns
Promise
<void
>
Implementation of
BucketStorageAdapter
.saveSyncData
setTargetCheckpoint()
setTargetCheckpoint(checkpoint): Promise<void>
Set a target checkpoint.
Parameters
Parameter | Type |
---|---|
checkpoint | Checkpoint |
Returns
Promise
<void
>
Implementation of
BucketStorageAdapter
.setTargetCheckpoint
startSession()
startSession(): void
Reset any caches.
Returns
void
Implementation of
BucketStorageAdapter
.startSession
syncLocalDatabase()
syncLocalDatabase(checkpoint): Promise<SyncLocalDatabaseResult>
Parameters
Parameter | Type |
---|---|
checkpoint | Checkpoint |
Returns
Promise
<SyncLocalDatabaseResult
>
Implementation of
BucketStorageAdapter
.syncLocalDatabase
updateLocalTarget()
updateLocalTarget(cb): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cb | () => Promise <string > |
Returns
Promise
<boolean
>
Implementation of
BucketStorageAdapter
.updateLocalTarget
validateChecksums()
validateChecksums(checkpoint): Promise<SyncLocalDatabaseResult>
Parameters
Parameter | Type |
---|---|
checkpoint | Checkpoint |
Returns
Promise
<SyncLocalDatabaseResult
>
writeTransaction()
writeTransaction<T>(callback, options?): Promise<T>
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
callback | (tx ) => Promise <T > |
options ? | object |
options.timeoutMs ? | number |
Returns
Promise
<T
>