skip to the page

@jam-overture/loom/postgres

The Postgres store. Same contract, a database behind it.

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.

29 exports, in 9 modules. Generated from ./dist/store/postgres.d.ts, which is the declaration file this package publishes for @jam-overture/loom/postgres. Each comment inside a declaration is shown as its first paragraph. The whole of it is in that file.

Install this first. @jam-overture/loom/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/postgres publishes 29 of the 2,237 names this package publishes. The other 2,208 are behind one of the 19 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.

Database

store/database

The database handle the postgres store and its migration share.

LoomDatabasetype

The narrowest Drizzle type that both the postgres.js and PGlite drivers satisfy. It lives alone so that migrate.ts and postgres.ts can share it without importing each other.

type LoomDatabase = PgDatabase<PgQueryResultHKT>;

Migrate

store/migrate

Creating the tables the postgres store expects.

TREE_STORE_DDLvalue

The schema, as statements a host can run.

const TREE_STORE_DDL: readonly string[]

HOLD_STORE_DDLvalue

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

const HOLD_STORE_DDL: readonly string[]

POLICY_LOG_DDLvalue

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

const POLICY_LOG_DDL: readonly string[]

APPLICATION_STORE_DDLvalue

The projects table.

const APPLICATION_STORE_DDL: readonly string[]

PROJECT_STORE_DDLvalue

The projects the applications are grouped under.

const PROJECT_STORE_DDL: readonly string[]

APPLICATION_ID_MIGRATIONvalue

Moving the ids themselves, which the rename above does not.

const APPLICATION_ID_MIGRATION: readonly string[]

AUDIENCE_OVERLAY_DDLvalue

The tables a page's audience rules and its per-audience forms are kept in.

const AUDIENCE_OVERLAY_DDL: readonly string[]

ensureTreeStoreSchemafunction

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

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

ensureHoldStoreSchemafunction

Creates the hold table if it is absent. Idempotent on the same terms.

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

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

ensurePolicyLogSchemafunction

Creates the policy log's table if it is absent. Idempotent on the same terms, and separate for the same reason: a deployment that wants a record of who changed its acceptance policy gets it by adding this call on purpose.

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

ensureApplicationStoreSchemafunction

Creates the projects table if it is absent. Idempotent, and separate for the same reason the other three are: a deployment that wants more than one project gets the table by adding this call on purpose.

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

ensureProjectStoreSchemafunction

Creates the projects table if it is absent. Idempotent on the same terms.

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

migrateApplicationIdsfunction

Carries prj_default to app_default across every table that names an application. Safe to run on a database that has already been carried, and on one that was never on the old value.

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

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

ensureAudienceOverlaySchemafunction

Creates the audience dimension's two tables if they are absent. Idempotent, and separate for the reason the other four are: a deployment that wants to serve one page to more than one audience gets the tables by adding this call on purpose.

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

Postgres

store/postgres

The store, backed by Postgres.

postgresTreeStorefunction

Every query below is filtered by the project this handle speaks for, and every write sets it. There is no path through this module that reads or writes a row belonging to another project, which is the one property a governance surface cannot get wrong: *a hold listing that spanned two apps would put one app's changes in another's queue.*

Shown in use on The history of a page — Where this actually runs, What your app has to do — The three things a change needs and Going to production — Three places state lives, and only one of them is your pages

const postgresTreeStore: (db: LoomDatabase, scope?: StoreScope) => TreeStore

Postgres applications

store/postgres-applications

The projects a deployment has, backed by Postgres.

postgresApplicationStorefunction

const postgresApplicationStore: (db: LoomDatabase) => ApplicationStore

Postgres audience

store/postgres-audience

The audience dimension, backed by Postgres. It is the table that AudienceOverlaySource was declared as a seam in place of, and it is the store dimension a page served per audience has been waiting on.

postgresAudienceOverlayStorefunction

Every query is filtered by the application this handle speaks for, and every write sets it.

const postgresAudienceOverlayStore: (db: LoomDatabase, scope?: StoreScope) => AudienceOverlayStore

Postgres holds

store/postgres-holds

Custody of held proposals, backed by Postgres.

postgresHoldStorefunction

Every query is filtered by the project this handle speaks for, and every write sets it.

Shown in use on Answering a held change — Where a waiting change waits, What your app has to do — The three things a change needs and Going to production — Three places state lives, and only one of them is your pages

const postgresHoldStore: (db: LoomDatabase, scope?: StoreScope) => HoldStore

Postgres policy log

store/postgres-policy-log

The policy's own log, backed by Postgres.

postgresPolicyLogfunction

Every query is filtered by the project this handle speaks for, and every write sets it.

const postgresPolicyLog: (db: LoomDatabase, scope?: StoreScope) => PolicyLog

Postgres projects

store/postgres-projects

The projects a deployment has, backed by Postgres.

postgresProjectStorefunction

const postgresProjectStore: (db: LoomDatabase) => ProjectStore

Schema

store/schema

Two tables: the log, and the snapshot it produces.

loomTreesvalue

The snapshot. document is the whole LoomTree, stored as JSON rather than decomposed into node rows — the tree is read and written whole, and a schema that shredded it would have to be migrated every time §1 changes the AST.

const loomTrees: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_trees";
    schema: undefined;
    columns: {
        applicationId: import("drizzle-orm/pg-core").PgColumn<{
            name: "application_id";
            tableName: "loom_trees";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        treeId: import("drizzle-orm/pg-core").PgColumn<{
            name: "tree_id";
            tableName: "loom_trees";
            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;
        }, {}, {}>;
        revision: import("drizzle-orm/pg-core").PgColumn<{
            name: "revision";
            tableName: "loom_trees";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        document: import("drizzle-orm/pg-core").PgColumn<{
            name: "document";
            tableName: "loom_trees";
            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;
        }, {}, {}>;
        updatedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "updated_at";
            tableName: "loom_trees";
            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";
}>

loomRevisionsvalue

The log. The composite primary key is load-bearing rather than incidental: it makes the *database* enforce the revision sequence, so two writers racing at the same base revision cannot both commit even if both passed the base-revision check before either finished. The in-memory store gets that property from being single-threaded; here it has to come from a constraint.

const loomRevisions: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_revisions";
    schema: undefined;
    columns: {
        applicationId: import("drizzle-orm/pg-core").PgColumn<{
            name: "application_id";
            tableName: "loom_revisions";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        treeId: import("drizzle-orm/pg-core").PgColumn<{
            name: "tree_id";
            tableName: "loom_revisions";
            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;
        }, {}, {}>;
        revision: import("drizzle-orm/pg-core").PgColumn<{
            name: "revision";
            tableName: "loom_revisions";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        proposalId: import("drizzle-orm/pg-core").PgColumn<{
            name: "proposal_id";
            tableName: "loom_revisions";
            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;
        }, {}, {}>;
        delta: import("drizzle-orm/pg-core").PgColumn<{
            name: "delta";
            tableName: "loom_revisions";
            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;
        }, {}, {}>;
        provenance: import("drizzle-orm/pg-core").PgColumn<{
            name: "provenance";
            tableName: "loom_revisions";
            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;
        }, {}, {}>;
        appliedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "applied_at";
            tableName: "loom_revisions";
            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;
        }, {}, {}>;
        answeredBy: import("drizzle-orm/pg-core").PgColumn<{
            name: "answered_by";
            tableName: "loom_revisions";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>

loomHoldsvalue

The custody of what the Gate held back.

const loomHolds: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_holds";
    schema: undefined;
    columns: {
        applicationId: import("drizzle-orm/pg-core").PgColumn<{
            name: "application_id";
            tableName: "loom_holds";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        proposalId: import("drizzle-orm/pg-core").PgColumn<{
            name: "proposal_id";
            tableName: "loom_holds";
            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;
        }, {}, {}>;
        treeId: import("drizzle-orm/pg-core").PgColumn<{
            name: "tree_id";
            tableName: "loom_holds";
            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;
        }, {}, {}>;
        baseRevision: import("drizzle-orm/pg-core").PgColumn<{
            name: "base_revision";
            tableName: "loom_holds";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        intent: import("drizzle-orm/pg-core").PgColumn<{
            name: "intent";
            tableName: "loom_holds";
            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;
        }, {}, {}>;
        proposal: import("drizzle-orm/pg-core").PgColumn<{
            name: "proposal";
            tableName: "loom_holds";
            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;
        }, {}, {}>;
        disposition: import("drizzle-orm/pg-core").PgColumn<{
            name: "disposition";
            tableName: "loom_holds";
            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;
        }, {}, {}>;
        heldAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "held_at";
            tableName: "loom_holds";
            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;
        }, {}, {}>;
    };
    dialect: "pg";
}>

loomPolicyRevisionsvalue

The policy's own log.

const loomPolicyRevisions: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_policy_revisions";
    schema: undefined;
    columns: {
        applicationId: import("drizzle-orm/pg-core").PgColumn<{
            name: "application_id";
            tableName: "loom_policy_revisions";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        policyId: import("drizzle-orm/pg-core").PgColumn<{
            name: "policy_id";
            tableName: "loom_policy_revisions";
            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;
        }, {}, {}>;
        revision: import("drizzle-orm/pg-core").PgColumn<{
            name: "revision";
            tableName: "loom_policy_revisions";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        fingerprint: import("drizzle-orm/pg-core").PgColumn<{
            name: "fingerprint";
            tableName: "loom_policy_revisions";
            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;
        }, {}, {}>;
        policy: import("drizzle-orm/pg-core").PgColumn<{
            name: "policy";
            tableName: "loom_policy_revisions";
            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;
        }, {}, {}>;
        actor: import("drizzle-orm/pg-core").PgColumn<{
            name: "actor";
            tableName: "loom_policy_revisions";
            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;
        }, {}, {}>;
        recordedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "recorded_at";
            tableName: "loom_policy_revisions";
            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;
        }, {}, {}>;
        note: import("drizzle-orm/pg-core").PgColumn<{
            name: "note";
            tableName: "loom_policy_revisions";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>

loomApplicationsvalue

The applications a deployment governs.

const loomApplications: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_applications";
    schema: undefined;
    columns: {
        applicationId: import("drizzle-orm/pg-core").PgColumn<{
            name: "application_id";
            tableName: "loom_applications";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        projectId: import("drizzle-orm/pg-core").PgColumn<{
            name: "project_id";
            tableName: "loom_applications";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        name: import("drizzle-orm/pg-core").PgColumn<{
            name: "name";
            tableName: "loom_applications";
            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;
        }, {}, {}>;
        createdAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "created_at";
            tableName: "loom_applications";
            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;
        }, {}, {}>;
        host: import("drizzle-orm/pg-core").PgColumn<{
            name: "host";
            tableName: "loom_applications";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        closedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "closed_at";
            tableName: "loom_applications";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>

loomProjectsvalue

The projects a deployment has, which group the applications above.

const loomProjects: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_projects";
    schema: undefined;
    columns: {
        projectId: import("drizzle-orm/pg-core").PgColumn<{
            name: "project_id";
            tableName: "loom_projects";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        name: import("drizzle-orm/pg-core").PgColumn<{
            name: "name";
            tableName: "loom_projects";
            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;
        }, {}, {}>;
        createdAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "created_at";
            tableName: "loom_projects";
            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;
        }, {}, {}>;
        repository: import("drizzle-orm/pg-core").PgColumn<{
            name: "repository";
            tableName: "loom_projects";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        closedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "closed_at";
            tableName: "loom_projects";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>

loomAudienceRulesvalue

A page's audience rules, as an append-only log of the whole ordered list.

const loomAudienceRules: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_audience_rules";
    schema: undefined;
    columns: {
        applicationId: import("drizzle-orm/pg-core").PgColumn<{
            name: "application_id";
            tableName: "loom_audience_rules";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        treeId: import("drizzle-orm/pg-core").PgColumn<{
            name: "tree_id";
            tableName: "loom_audience_rules";
            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;
        }, {}, {}>;
        revision: import("drizzle-orm/pg-core").PgColumn<{
            name: "revision";
            tableName: "loom_audience_rules";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        rules: import("drizzle-orm/pg-core").PgColumn<{
            name: "rules";
            tableName: "loom_audience_rules";
            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;
        }, {}, {}>;
        actor: import("drizzle-orm/pg-core").PgColumn<{
            name: "actor";
            tableName: "loom_audience_rules";
            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;
        }, {}, {}>;
        recordedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "recorded_at";
            tableName: "loom_audience_rules";
            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;
        }, {}, {}>;
    };
    dialect: "pg";
}>

loomAudienceFormsvalue

The delta each audience earns, one row per audience per page.

const loomAudienceForms: import("drizzle-orm/pg-core").PgTableWithColumns<{
    name: "loom_audience_forms";
    schema: undefined;
    columns: {
        applicationId: import("drizzle-orm/pg-core").PgColumn<{
            name: "application_id";
            tableName: "loom_audience_forms";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        treeId: import("drizzle-orm/pg-core").PgColumn<{
            name: "tree_id";
            tableName: "loom_audience_forms";
            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;
        }, {}, {}>;
        audienceId: import("drizzle-orm/pg-core").PgColumn<{
            name: "audience_id";
            tableName: "loom_audience_forms";
            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;
        }, {}, {}>;
        delta: import("drizzle-orm/pg-core").PgColumn<{
            name: "delta";
            tableName: "loom_audience_forms";
            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;
        }, {}, {}>;
        baseRevision: import("drizzle-orm/pg-core").PgColumn<{
            name: "base_revision";
            tableName: "loom_audience_forms";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        actor: import("drizzle-orm/pg-core").PgColumn<{
            name: "actor";
            tableName: "loom_audience_forms";
            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;
        }, {}, {}>;
        authoredAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "authored_at";
            tableName: "loom_audience_forms";
            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;
        }, {}, {}>;
        withdrawnBy: import("drizzle-orm/pg-core").PgColumn<{
            name: "withdrawn_by";
            tableName: "loom_audience_forms";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        withdrawnAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "withdrawn_at";
            tableName: "loom_audience_forms";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>