skip to the page

@jam-overture/loom/telemetry/postgres

The Postgres journal, for a deployment that keeps its telemetry.

Everything below is exported from that import. The names, the signatures and the sentences are read from the package itself rather than written here, so this page says what the copy of Loom in your node_modules says — and it changes in the same pull request the code does.

4 exports, in 3 modules. Generated from ./dist/telemetry/postgres.d.ts, which is the declaration file this package publishes for @jam-overture/loom/telemetry/postgres.

Install this first. @jam-overture/loom/telemetry/postgres loads it the moment the import runs. Without it, the import itself fails — before any of your own code has run.

  • drizzle-orm^0.45.2optional peer dependency
pnpm add drizzle-orm

No import here has everything behind it. @jam-overture/loom/telemetry/postgres publishes 4 of the 1,298 names this package publishes. The other 1,294 are behind one of the 16 other imports, and not one of those imports publishes a single name this one does. The imports do not nest: a name that is not on this page is not a name that does not exist, and the search at the top of the page says which import it comes from.

Migrate

telemetry/migrate

Creating the table the telemetry journal writes to, with its row level security switched on.

TELEMETRY_DDLvalue

The journal's schema, as statements a host can run.

const TELEMETRY_DDL: readonly string[]

ensureTelemetrySchemafunction

Idempotent, so running it against a populated database is a no-op.

Shown in use on Going to production — Creating them is one call, and running it twice is a no-op

const ensureTelemetrySchema: (db: LoomDatabase) => Promise<void>

Postgres

telemetry/postgres

The journal, backed by Postgres — the same database the store uses, and the same rule about how it is reached: plain SQL through Drizzle, never PostgREST.

postgresTelemetryJournalfunction

Shown in use on What every ask leaves behind — Turning it on is six lines and one decision and Going to production — Three places state lives, and only one of them is your pages

const postgresTelemetryJournal: (db: LoomDatabase) => TelemetryJournal

Schema

telemetry/schema

The table the telemetry journal is stored in, as Drizzle sees it.

loomTelemetryvalue

One table, because a journal is one thing: an append-only list of what the runtime narrated.

const loomTelemetry: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_telemetry";
    schema: undefined;
    columns: {
        seq: import("drizzle-orm/pg-core").PgColumn<{
            name: "seq";
            tableName: "loom_telemetry";
            dataType: "number";
            columnType: "PgBigSerial53";
            data: number;
            driverParam: number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        treeId: import("drizzle-orm/pg-core").PgColumn<{
            name: "tree_id";
            tableName: "loom_telemetry";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        occurredAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "occurred_at";
            tableName: "loom_telemetry";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        event: import("drizzle-orm/pg-core").PgColumn<{
            name: "event";
            tableName: "loom_telemetry";
            dataType: "json";
            columnType: "PgJsonb";
            data: unknown;
            driverParam: unknown;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        recordedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "recorded_at";
            tableName: "loom_telemetry";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>