Member Junction
    Preparing search index...

    Writes one record's resolved output mapping: child rows (inserted, or reconciled on their key), then the record's own fields.

    Index

    Constructors

    Properties

    Accessors

    Methods

    • Adds a written value to the group of the related column its constraint references, or reports a missing one.

      Parameters

      • targets: Map<string, ForeignKeyTarget>
      • problems: string[]
      • fieldInfo: EntityFieldInfo
      • ref: ForeignKeyRef

      Returns void

    • Creates the related row a create miss asks for (match field only) and caches its key; a dry run returns a preview key.

      Parameters

      • related: string
      • matchField: string
      • text: string
      • keyName: string
      • cacheKey: string

      Returns Promise<string | number>

    • The mapped fields whose value differs from the record's (ValuesEqual) and holds no value a person entered, for the real write and the dry-run preview (PreviewFields).

      Parameters

      • entity: EntityInfo
      • obj: BaseEntity
      • fields: Record<string, unknown>
      • recordPreserved: boolean

        record each preserved human value (the real write); false for the preview

      Returns Promise<[string, unknown][]>

    • Looks up the related row whose match field equals text and returns its key (a hit is cached for the run); a miss follows onMiss: null (never cached), an error, or a new row.

      Parameters

      • field: string
      • related: string
      • matchField: string
      • text: string
      • onMiss: NonNullable<"null" | "fail" | "create">

      Returns Promise<string | number>

    • The written values with no row in their related entity: one RunView of the related column per entity. A value that is not a UUID cannot be a key of a uniqueidentifier column; a related column of another type is not checked.

      Parameters

      • target: ForeignKeyTarget

      Returns Promise<string[]>

    • True when the field holds a value a person entered and the run does not overwrite it (see OutputMappingWriterOptions.Withheld); with recordPreserved the value is recorded and reported. An empty field is never asked about.

      Parameters

      • entity: EntityInfo
      • field: string
      • current: unknown
      • recordPreserved: boolean

      Returns Promise<boolean>

    • The record's fields the real write changes (FieldChanges) and what it would fail on: a changed UUID value with no row in its related entity, or a record that does not exist. Writes nothing.

      Parameters

      Returns Promise<{ Changes: Record<string, unknown>; Problems: string[] }>

    • The key column of a lookup's related entity; throws when it is not in metadata or has no primary key.

      Parameters

      • related: string

      Returns string

    • The stored form of one mapped field value: a match string becomes the related row's key by the mapping's lookup rules; a UUID, or a value of a field that is not a foreign key, is returned unchanged.

      Parameters

      • entity: EntityInfo
      • field: string
      • val: unknown

        the mapped value; unknown because it comes from ResolveMappingRef

      Returns Promise<unknown>

    • The stored form of a value the pipeline wrote earlier, read-only: any lookup miss is null; nothing is created.

      Parameters

      Returns Promise<unknown>

    • On a run that overwrites human values, retires each mapped field's Human value (sequentially, in the unit's transaction).

      Parameters

      • fieldNames: string[]

      Returns Promise<void>

    • A foreign key that cannot be resolved: null, or an error under onLookupMiss: 'fail'.

      Parameters

      • field: string
      • onMiss: NonNullable<"null" | "fail" | "create">
      • reason: string

      Returns null

    • Saves the record's mapped fields that differ from its current values and hold no value a person entered. A run that overwrites human values then retires the Human value of every mapped field.

      Parameters

      • entity: EntityInfo

        the processed record's entity

      • fields: Record<string, unknown>

        the resolved field values (foreign keys already resolved)

      Returns Promise<void>

    • Dates compare by instant; a value that is not a date compares as exact text.

      Parameters

      • stored: unknown
      • proposed: unknown

      Returns boolean

    • The match value inside a mapped value (an array's first element, an object's Name); null when not a string or number.

      Parameters

      • val: unknown

      Returns string | number

    • Normalises one part of a reconcile key as a case-insensitive key column compares it: null is '', a uniqueidentifier is NormalizeUUIDd, anything else is lower-cased with trailing spaces removed.

      Parameters

      • field: EntityFieldInfo

        the key field's metadata, when the entity declares it

      • v: unknown

        a mapped value or an entity field value; unknown because config-named fields carry no compile-time type

      Returns string

    • Whether a stored value equals a value the pipeline wrote, for the ownership question: typed fields by ValuesEqual, text (and undeclared fields) with case and trailing spaces ignored, as the collation compares.

      Parameters

      • field: EntityFieldInfo
      • stored: unknown

        the field's value; unknown for the reason given on NormalizeKeyPart

      • resolved: unknown

        the pipeline's resolved value; likewise unknown

      Returns boolean

    • Rounds half away from zero to scale digits, as SQL Server stores it (the epsilon corrects binary halves).

      Parameters

      • x: number
      • scale: number

      Returns number

    • Whether a stored field value already equals a proposed one, by the field's type: UUIDs case-insensitively, dates by instant, decimals at the column's scale, numbers numerically, booleans by truth, anything else as exact text.

      Parameters

      • field: EntityFieldInfo
      • stored: unknown

        the record's current value (BaseEntity.Get)

      • proposed: unknown

        the mapped value; both unknown for the reason given on NormalizeKeyPart

      Returns boolean