prorm API Reference
    Preparing search index...

    Class QldbStore

    QldbStore wraps an amazon-qldb-driver-nodejs driver behind the shared ledger surface. append inserts a new document (returning its QLDB document id), get reads the current revision by document id, history returns every prior revision via the history() PartiQL function, verify returns a document's revision metadata (content hash + block address - QLDB's tamper-evidence proof material), and query is the raw PartiQL escape hatch.

    Implements

    Index
    name: "qldb" = 'qldb'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "amazon-qldb-driver-nodejs" = 'amazon-qldb-driver-nodejs'

    The client library being used

    • Insert data as a new document into table, returning its QLDB document id (the stable identifier every revision of the document shares). Runs INSERT INTO <table> ?.

      Parameters

      • table: string
      • data: unknown

      Returns Promise<string>

    • Read the current revision of the document with QLDB document id id, addressed via PartiQL's BY clause. Returns the row or null.

      Parameters

      • table: string
      • id: string

      Returns Promise<unknown>

    • Return every revision (including deletions) of the document with id id via the history(<table>) PartiQL function. Each entry carries data, metadata, blockAddress and hash.

      Parameters

      • table: string
      • id: string

      Returns Promise<unknown[]>

    • Return the tamper-evidence proof material for document id: its revision metadata (content hash + version) and blockAddress from the journal, pulled from history(). This is the data QLDB's server-side digest/proof APIs cryptographically verify a revision against.

      Parameters

      • table: string
      • id: string

      Returns Promise<{ documentId: string; revisions: unknown[] }>

    • Run a raw PartiQL statement with optional positional params.

      Parameters

      • statement: string
      • params: unknown[] = []

      Returns Promise<unknown[]>

    • Fetch every document in table matching the ORM where clause. The where clause is compiled to a parameterized PartiQL WHERE; order, limit and offset are applied client-side because QLDB's PartiQL dialect supports none of them.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • table: string
      • options: QldbFindOptions = {}

      Returns Promise<T[]>

    • Fetch the first document matching where (client-side limit 1), or null.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • table: string
      • options: QldbFindOptions = {}

      Returns Promise<T | null>

    • Count documents in table matching where.

      Parameters

      • table: string
      • Optionalwhere: Record<string, any>

      Returns Promise<number>

    • Insert data as a new document, returning its QLDB document id. Alias of append using ORM naming.

      Parameters

      • table: string
      • data: Record<string, unknown>

      Returns Promise<string>

    • Insert many documents in a single managed transaction, returning the new document ids in order.

      Parameters

      • table: string
      • rows: Record<string, unknown>[]

      Returns Promise<string[]>

    • Update every document matching where, SETting each key in values. Returns the number of documents QLDB reported as modified.

      Parameters

      • table: string
      • values: Record<string, unknown>
      • Optionalwhere: Record<string, any>

      Returns Promise<number>

    • Delete every document matching where. Returns the number of documents QLDB reported as deleted. QLDB retains all prior revisions in the journal, so a delete is itself a new (tombstone) revision - use history to recover deleted data.

      Parameters

      • table: string
      • Optionalwhere: Record<string, any>

      Returns Promise<number>

    • Insert-or-update: within a single transaction, look for a document matching where; if one exists, SET data onto the matches, otherwise INSERT data (merged with the where equality keys). Returns { created } indicating which branch ran.

      Parameters

      • table: string
      • data: Record<string, unknown>
      • where: Record<string, any>

      Returns Promise<{ created: boolean }>

    • Run fn inside a single managed QLDB transaction (auto-retried on optimistic-concurrency conflicts). The callback receives the raw transaction executor so it can compose several statements atomically.

      Type Parameters

      • T

      Parameters

      • fn: (txn: QldbTransactionLike) => T | Promise<T>

      Returns Promise<T>

    • List the active table names in the ledger (thin passthrough).

      Returns Promise<string[]>