prorm API Reference
    Preparing search index...

    Class ScyllaStore

    ScyllaStore wraps a cassandra-driver Client and exposes CQL execution (execute), atomic multi-statement batches (batch), and a few parameterized convenience helpers (insert, selectAll).

    Statements are prepared by default (prepare: true) so the driver can cache query metadata, infer parameter types, and route requests to the shard/replica that owns the partition — the recommended default for anything run more than once, and especially valuable on ScyllaDB's shard-aware driver path.

    Implements

    Index
    name: "scylladb" = 'scylladb'

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

    library: "cassandra-driver" = 'cassandra-driver'

    The client library being used

    • Execute a single CQL statement with optional bound params. Statements are prepared by default (prepare: true); pass opts.prepare = false to run a one-off unprepared. Any other driver query options are forwarded via opts. Returns the full driver result (with .rows).

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • query: string
      • params: unknown[] = []
      • opts: ScyllaQueryOptions = {}

      Returns Promise<ScyllaResult<T>>

    • Execute multiple statements as a single logged batch (atomic across the statements, though not isolated — CQL batches are not SQL transactions). Each entry is a { query, params } pair. Prepared by default; forward other driver batch options via opts.

      Parameters

      • queries: ScyllaBatchQuery[]
      • opts: ScyllaQueryOptions = {}

      Returns Promise<ScyllaResult<Record<string, unknown>>>

    • Convenience INSERT: builds a parameterized INSERT INTO table (cols...) VALUES (?, ?, ...) from obj's keys and executes it (prepared). For upserts with TTL, IF NOT EXISTS, or other clauses, write the CQL yourself and call execute().

      Parameters

      • table: string
      • obj: Record<string, unknown>
      • opts: ScyllaQueryOptions = {}

      Returns Promise<ScyllaResult<Record<string, unknown>>>

    • Convenience SELECT * FROM table. Returns the full driver result (with .rows).

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • table: string
      • opts: ScyllaQueryOptions = {}

      Returns Promise<ScyllaResult<T>>