prorm API Reference
    Preparing search index...

    Class MaterializeStore

    MaterializeStore wraps a pg client connected to Materialize and exposes query(sql, params) for reads/DDL, plus createSource() and createMaterializedView() convenience helpers for the streaming-specific DDL that defines what Materialize keeps incrementally up to date.

    Implements

    Index
    name: "materialize" = 'materialize'

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

    library: "pg" = 'pg'

    The client library being used

    • Execute a SQL statement over the Postgres wire with optional positional params and return the result rows (pg's result.rows).

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • sql: string
      • Optionalparams: unknown[]

      Returns Promise<T[]>

    • Create a streaming SOURCE via CREATE SOURCE <name> <definition>, e.g. createSource('kafka_src', "FROM KAFKA CONNECTION ... (TOPIC 'events')"). Returns the driver result rows.

      Parameters

      • name: string
      • definition: string

      Returns Promise<any[]>

    • Create a MATERIALIZED VIEW (kept incrementally up to date) via CREATE MATERIALIZED VIEW <name> AS <selectSql>. Returns the driver result rows.

      Parameters

      • name: string
      • selectSql: string

      Returns Promise<any[]>