prorm API Reference
    Preparing search index...

    Function attachExternalFields

    • Attach external-field accessors to a row instance.

      Each field avatar gets:

      • avatar a non-enumerable accessor holding the materialized value
      • loadAvatar() read from the store into avatar
      • saveAvatar(value) write to the store and persist the key column
      • deleteAvatar() remove from the store and null the key column

      The accessor is deliberately non-enumerable so save()'s sweep over the instance's own keys doesn't try to persist a Buffer into a column that doesn't exist. Assigning to it records a pending write, which the wrapped save() flushes before the row is written.

      Parameters

      • rowInstance: any
      • dataValues: Record<string, any>
      • modelName: string
      • tableName: string
      • registry: ExternalStoreRegistry

      Returns void