ObjectStackObjectStack

External Catalog — Data Protocol reference

ExternalCatalog — cached remote-schema snapshot for a federated datasource.

ExternalCatalog — cached remote-schema snapshot for a federated datasource (ADR-0015 §4.3).

Introspecting a mature warehouse on every boot is expensive, so the IExternalDatasourceService.refreshCatalog persists a snapshot of the remote tables/columns as an external_catalog metadata record. The boot-validation gate (Gate 2) and Studio's schema browser read from it; drift is detected by diffing a fresh introspection against the snapshot.

Source: packages/spec/src/data/external-catalog.zod.ts

TypeScript Usage

import { ExternalCatalogSchema, ExternalColumnSchema, ExternalTableSchema } from '@objectstack/spec/data';
import type { ExternalCatalog, ExternalColumn, ExternalTable } from '@objectstack/spec/data';

// Validate data
const result = ExternalCatalogSchema.parse(data);

ExternalCatalog

Properties

PropertyTypeRequiredDescription
namestring✅Catalog id, conventionally <datasource>_catalog.
datasourcestring✅Datasource.name this catalog snapshots.
snapshotAtstring✅When the snapshot was taken (ISO 8601).
dialectstringoptionalRemote SQL dialect, when known.
tables{ remoteSchema?: string; remoteName: string; columns: object[]; indexes?: object[]; … }[]✅Snapshotted remote tables.

Nested Shape: ExternalCatalog.tables[number]

PropertyTypeRequiredDescription
remoteSchemastringoptionalRemote schema/database qualifier
remoteNamestring✅Remote table/view name
columns{ name: string; sqlType: string; nullable: boolean; primaryKey?: boolean; … }[]✅Remote columns
indexes{ name: string; columns: string[]; unique: boolean }[]optionalRemote indexes, when introspectable
rowCountEstimatenumberoptionalApproximate row count

ExternalColumn

Properties

PropertyTypeRequiredDescription
namestring✅Remote column name
sqlTypestring✅Raw remote SQL type (e.g. "numeric(10,2)")
nullableboolean✅Whether the remote column is nullable
primaryKeybooleanoptional (default: false)Part of the remote primary key
suggestedFieldTypestringoptionalObjectStack field type suggested by the type-compat matrix

ExternalTable

Properties

PropertyTypeRequiredDescription
remoteSchemastringoptionalRemote schema/database qualifier
remoteNamestring✅Remote table/view name
columns{ name: string; sqlType: string; nullable: boolean; primaryKey?: boolean; … }[]✅Remote columns
indexes{ name: string; columns: string[]; unique: boolean }[]optionalRemote indexes, when introspectable
rowCountEstimatenumberoptionalApproximate row count

Nested Shape: ExternalTable.columns[number]

PropertyTypeRequiredDescription
namestring✅Remote column name
sqlTypestring✅Raw remote SQL type (e.g. "numeric(10,2)")
nullableboolean✅Whether the remote column is nullable
primaryKeybooleanoptional (default: false)Part of the remote primary key
suggestedFieldTypestringoptionalObjectStack field type suggested by the type-compat matrix

On this page