Skip to content

AsyncMapTransaction

Defined in: src/backends/store/map.ts:62

T extends Store & AsyncMap = Store & AsyncMap

new AsyncMapTransaction<T>(store): AsyncMapTransaction<T>

Defined in: src/backends/store/store.ts:85

T

AsyncMapTransaction<T>

AsyncTransaction.constructor

protected asyncDone: Promise<unknown>

Defined in: src/backends/store/store.ts:189

AsyncTransaction.asyncDone


readonly store: T

Defined in: src/backends/store/store.ts:85

AsyncTransaction.store

_cached(id, info?): Resource<number> | undefined

Defined in: src/backends/store/store.ts:204

Internal

Gets a cache resource If info is set and the resource doesn’t exist, it will be created

number

number

Resource<number> | undefined

AsyncTransaction._cached


optional abort(): Promise<void>

Defined in: src/backends/store/store.ts:139

Discards the changes, which stores with the atomic flag must implement

Promise<void>

AsyncTransaction.abort


optional abortSync(): void

Defined in: src/backends/store/store.ts:142

Discards the changes, which stores with the atomic flag must implement

void

AsyncTransaction.abortSync


protected async(promise): void

Defined in: src/backends/store/store.ts:195

Internal

Run a asynchronous operation from a sync context. Not magic and subject to (race) conditions.

Promise<unknown>

void

AsyncTransaction.async


optional commit(): Promise<void>

Defined in: src/backends/store/store.ts:133

Applies the changes, which stores with the atomic flag must implement

Promise<void>

AsyncTransaction.commit


optional commitSync(): void

Defined in: src/backends/store/store.ts:136

Applies the changes, which stores with the atomic flag must implement

void

AsyncTransaction.commitSync


get(id, offset?, end?): Promise<Uint8Array<ArrayBufferLike> | undefined>

Defined in: src/backends/store/map.ts:68

Retrieves data.

number

The key to look under for data.

number

number

Promise<Uint8Array<ArrayBufferLike> | undefined>

AsyncTransaction.get


getSync(id, offset?, end?): Uint8Array<ArrayBufferLike> | undefined

Defined in: src/backends/store/map.ts:73

Retrieves data. Throws an error if an error occurs or if the key does not exist.

number

The key to look under for data.

number

number

Uint8Array<ArrayBufferLike> | undefined

The data stored under the key, or undefined if not present.

AsyncTransaction.getSync


keys(): Promise<Iterable<number, any, any>>

Defined in: src/backends/store/map.ts:63

Gets all of the keys

Promise<Iterable<number, any, any>>

AsyncTransaction.keys


remove(id): Promise<void>

Defined in: src/backends/store/map.ts:82

Deletes the data at ino.

number

The key to delete from the store.

Promise<void>

AsyncTransaction.remove


removeSync(id): void

Defined in: src/backends/store/store.ts:238

Deletes the data at ino.

number

The key to delete from the store.

void

AsyncTransaction.removeSync


set(id, data, offset?): Promise<void>

Defined in: src/backends/store/map.ts:77

Stores data under an id. Without offset, replaces any existing data. With offset, writes the data at offset and keeps the rest, which partial stores must support.

number

Uint8Array

number = 0

Promise<void>

AsyncTransaction.set


setSync(id, data, offset?): void

Defined in: src/backends/store/store.ts:234

Stores data under an id. Without offset, replaces any existing data. With offset, writes the data at offset and keeps the rest, which partial stores must support.

number

Uint8Array

number

void

AsyncTransaction.setSync