Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ReadTransaction

ReadTransactions are used with Replicache.query and allows read operations on the database.

Hierarchy

Implemented by

Index

Methods

Methods

get

  • get(key: string): Promise<JSONValue | undefined>
  • Get a single value from the database. If the key is not present this returns undefined.

    Parameters

    • key: string

    Returns Promise<JSONValue | undefined>

has

  • has(key: string): Promise<boolean>
  • Determines if a single key is present in the database.

    Parameters

    • key: string

    Returns Promise<boolean>

scan

  • scan(__namedParameters?: { indexName: undefined | string; limit: undefined | number; prefix: undefined | string; start: undefined | ScanBound }): ScanResult
  • Gets many values from the database. This returns a ScanResult which implements AsyncIterable. It also has methods to iterate over the keys and entries.

    It the ScanResult is used after the ReadTransaction has been closed it will throw a TransactionClosedError.

    Parameters

    • Optional __namedParameters: { indexName: undefined | string; limit: undefined | number; prefix: undefined | string; start: undefined | ScanBound }
      • indexName: undefined | string
      • limit: undefined | number
      • prefix: undefined | string
      • start: undefined | ScanBound

    Returns ScanResult

scanAll

  • scanAll(options?: ScanOptions): Promise<[][]>
  • Convenience for scan() that reads all results into an array.

    Parameters

    • Optional options: ScanOptions

    Returns Promise<[][]>

Generated using TypeDoc