Skip to content

SyncTransaction

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

Transaction that implements asynchronous operations with synchronous ones

T extends Store = Store

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

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

T

SyncTransaction<T>

Transaction.constructor

readonly store: T

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

Transaction.store

abort(): Promise<void>

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

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

Promise<void>

Transaction.abort


optional abortSync(): void

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

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

void

Transaction.abortSync


commit(): Promise<void>

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

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

Promise<void>

Transaction.commit


optional commitSync(): void

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

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

void

Transaction.commitSync


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

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

Retrieves data.

number

The key to look under for data.

number

number

Promise<Uint8Array<ArrayBufferLike> | undefined>

Transaction.get


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

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

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.

Transaction.getSync


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

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

Gets all of the keys

Promise<Iterable<number, any, any>>

Transaction.keys


remove(id): Promise<void>

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

Deletes the data at ino.

number

The key to delete from the store.

Promise<void>

Transaction.remove


abstract removeSync(id): void

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

Deletes the data at ino.

number

The key to delete from the store.

void

Transaction.removeSync


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

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

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

Promise<void>

Transaction.set


abstract setSync(id, data, offset?): void

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

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

Transaction.setSync