Interface LDMigrationOptions<TMigrationRead, TMigrationWrite, TMigrationReadInput, TMigrationWriteInput>

Configuration for a migration.

Type Parameters

  • TMigrationRead

  • TMigrationWrite

  • TMigrationReadInput

  • TMigrationWriteInput

Hierarchy

  • LDMigrationOptions

Properties

check?: ((a, b) => boolean)

Type declaration

    • (a, b): boolean
    • Method used to do consistency checks for read operations. After a read operation, during which both data sources are read from, a check of read consistency may be done using this method.

      Parameters

      • a: TMigrationRead
      • b: TMigrationRead

      Returns boolean

errorTracking?: boolean

Configure the error tracking for the migration.

Defaults to true.

Configure how the migration should execute. If omitted the execution will be concurrent.

latencyTracking?: boolean

Configure the latency tracking for the migration.

Defaults to true.

readNew: ((payload?) => Promise<LDMethodResult<TMigrationRead>>)

Type declaration

    • (payload?): Promise<LDMethodResult<TMigrationRead>>
    • Implementation which provides a read from the "new" source.

      Users are required to provide two different read methods -- one to read from the old migration source, and one to read from the new source. Additionally, customers can opt-in to consistency tracking by providing a check function.

      Depending on the migration stage, one or both of these read methods may be called.

      Throwing an exception from this method will be treated as an error.

      Parameters

      • Optional payload: TMigrationReadInput

        An optional payload. The payload is provided when calling the read method on the migration.

        Optional

      Returns Promise<LDMethodResult<TMigrationRead>>

      The result of the operation. Use LDMigrationSuccess or LDMigrationError to create a suitable return value.

readOld: ((payload?) => Promise<LDMethodResult<TMigrationRead>>)

Type declaration

    • (payload?): Promise<LDMethodResult<TMigrationRead>>
    • Implementation which provides a read from the "old" source.

      Users are required to provide two different read methods -- one to read from the old migration source, and one to read from the new source. Additionally, customers can opt-in to consistency tracking by providing a check function.

      Depending on the migration stage, one or both of these read methods may be called.

      Throwing an exception from this method will be treated as an error.

      Parameters

      • Optional payload: TMigrationReadInput
        Optional

      Returns Promise<LDMethodResult<TMigrationRead>>

writeNew: ((payload?) => Promise<LDMethodResult<TMigrationWrite>>)

Type declaration

    • (payload?): Promise<LDMethodResult<TMigrationWrite>>
    • Implementation which provides a write to the "new" source.

      Users are required to provide two different write methods -- one to write to the old migration source, and one to write to the new source. Not every stage requires

      Depending on the migration stage, one or both of these write methods may be called.

      Throwing an exception from this method will be treated as an error.

      Parameters

      • Optional payload: TMigrationWriteInput

        An optional payload. The payload is provided when calling the read method on the migration.

        Optional

      Returns Promise<LDMethodResult<TMigrationWrite>>

      The result of the operation. Use LDMigrationSuccess or LDMigrationError to create a suitable return value.

writeOld: ((payload?) => Promise<LDMethodResult<TMigrationWrite>>)

Type declaration

    • (payload?): Promise<LDMethodResult<TMigrationWrite>>
    • Implementation which provides a write to the "old" source.

      Users are required to provide two different write methods -- one to write to the old migration source, and one to write to the new source. Not every stage requires

      Depending on the migration stage, one or both of these write methods may be called.

      Throwing an exception from this method will be treated as an error.

      Parameters

      • Optional payload: TMigrationWriteInput

        An optional payload. The payload is provided when calling the read method on the migration.

        Optional

      Returns Promise<LDMethodResult<TMigrationWrite>>

      The result of the operation. Use LDMigrationSuccess or LDMigrationError to create a suitable return value.

Generated using TypeDoc