Member Junction
    Preparing search index...

    Configuration for related entity synchronization

    Defines how to pull and push related entities that have foreign key relationships with a parent entity. Supports nested relationships for deep object graphs. NEW: Supports automatic recursive patterns for self-referencing entities.

    interface RelatedEntityConfig {
        entity: string;
        excludeFields?: string[];
        externalizeFields?:
            | string[]
            | { [fieldName: string]: { extension?: string } }
            | { field: string; pattern: string }[];
        filter?: string;
        foreignKey: string;
        lookupFields?: { [fieldName: string]: { entity: string; field: string } };
        maxDepth?: number;
        recursive?: boolean;
        relatedEntities?: Record<string, RelatedEntityConfig>;
    }
    Index

    Properties

    entity: string

    Name of the related entity to sync

    excludeFields?: string[]

    Fields to exclude from the pulled data for this related entity

    externalizeFields?:
        | string[]
        | { [fieldName: string]: { extension?: string } }
        | { field: string; pattern: string }[]

    Fields to externalize to separate files for this related entity

    Type Declaration

    • string[]
    • { [fieldName: string]: { extension?: string } }
    • { field: string; pattern: string }[]
      • field: string

        Field name to externalize

      • pattern: string

        Pattern for the output file. Supports placeholders from the entity

    filter?: string

    Optional SQL filter to apply when pulling related records

    foreignKey: string

    Field name that contains the foreign key reference to parent (e.g., "PromptID")

    lookupFields?: { [fieldName: string]: { entity: string; field: string } }

    Foreign key fields to convert to

    references for this related entity

    maxDepth?: number

    Maximum depth for recursive fetching (optional, defaults to 10) Prevents infinite loops and controls memory usage Only applies when recursive is true

    recursive?: boolean

    Enable recursive fetching for self-referencing entities When true, automatically fetches all levels of the hierarchy until no more children found

    relatedEntities?: Record<string, RelatedEntityConfig>

    Nested related entities for deep object graphs