Member Junction
    Preparing search index...

    Reads and creates for one catalog, scoped to whatever "this connector" means for it.

    ObjectsInScope deliberately returns rows of EVERY status. Disabled rows are load-bearing: an object the source dropped is disabled rather than deleted, and if it reappears the overlay must find and reactivate that row. Matching active rows only would attempt a second row with the same name and hit the unique constraint instead.

    These read straight from the database rather than the engine cache, deliberately. The cache is refreshed between discovery passes, not within one, so the write path must be able to see rows a previous pass of the SAME run just persisted. It is also what makes the per-connection catalog writable at all: its cached rows are read-only projections with no Save().

    interface CatalogWriter {
        Source: "Shared" | "PerConnection";
        AdoptDeclaration(
            row: MJIntegrationObjectEntity | MJIntegrationObjectFieldEntity,
            declared: MJIntegrationObjectEntity | MJIntegrationObjectFieldEntity,
            kind: "object" | "field",
        ): string[];
        FieldsForObject(
            objectID: string,
        ): Promise<MJIntegrationObjectFieldEntity[]>;
        KeyedObjectIDs(objectIDs: readonly string[]): Promise<Set<string>>;
        LoadField(fieldID: string): Promise<MJIntegrationObjectFieldEntity>;
        LoadObject(objectID: string): Promise<MJIntegrationObjectEntity>;
        MarkSeen(
            row: MJIntegrationObjectEntity | MJIntegrationObjectFieldEntity,
            sampled: boolean,
        ): void;
        NewFieldRow(): Promise<MJIntegrationObjectFieldEntity>;
        NewObjectRow(): Promise<MJIntegrationObjectEntity>;
        ObjectsInScope(): Promise<MJIntegrationObjectEntity[]>;
        RebaseFromDeclared(
            row: MJIntegrationObjectEntity | MJIntegrationObjectFieldEntity,
            declared: MJIntegrationObjectEntity | MJIntegrationObjectFieldEntity,
            kind: "object" | "field",
        ): string[];
        RetireField(
            row: MJIntegrationObjectFieldEntity,
        ): Promise<{ deleted: boolean; ok: boolean }>;
        RetireObject(
            row: MJIntegrationObjectEntity,
        ): Promise<{ deleted: boolean; ok: boolean }>;
        StampNewField(
            row: MJIntegrationObjectFieldEntity,
            declaredFieldID: string,
            provenance: CatalogProvenance,
        ): void;
        StampNewObject(
            row: MJIntegrationObjectEntity,
            declaredObjectID: string,
            provenance: CatalogProvenance,
        ): void;
    }

    Implemented by

    Index

    Properties

    Source: "Shared" | "PerConnection"

    Methods

    • MJ-CAT-21 — an EXISTING per-connection row has just been matched to a declaration. Rebase it, and record that it is now a declared row rather than one this connection merely found.

      The second half is the load-bearing one. A field this connection discovered BEFORE the connector declared it keeps MetadataSource = 'Discovered', and decidePKPromotion reads exactly that to rule that a declared primary key cannot include it — so a rebase on its own sets IsPrimaryKey and has it demoted again a few statements later, which is precisely how PheedLoop 1.4.6's new eventCode key reached a connection's catalog as an ordinary column. A row that now has a declaration is no longer merely discovered.

      Not StampNewField: that one also clears IsSelected and resets FirstSeenAt, which would deselect a table the customer chose and forget when the field first appeared.

      Shared writers no-op — there the row IS the declaration, and writing provenance onto it would be writing it onto itself.

      Returns string[]

    • Lowercased ids of the given objects that already carry a primary key, from one two-column scan per 200 owners. The classify stage used to load every object's fields as entity objects just to ask some(IsPrimaryKey); the keyed majority needs nothing else.

      Parameters

      • objectIDs: readonly string[]

      Returns Promise<Set<string>>