setTableReplicationTransform<TableDsl extends Table, D> abstract method

void setTableReplicationTransform<TableDsl extends Table, D>(
  1. TableInfo<TableDsl, D> table, {
  2. required Insertable<D> transformInbound(
    1. D row
    ),
  3. required Insertable<D> transformOutbound(
    1. D row
    ),
  4. Insertable<D> toInsertable(
    1. D
    )?,
})

Puts transforms in place such that any data being replicated to or from this table is first handled appropriately while retaining type consistency.

Can be used to encrypt sensitive fields before they are replicated outside of their secure local source.

NOTE: usage is discouraged, but ensure transforms are set before replication is initiated using syncTable to avoid partially transformed tables.

Implementation

void setTableReplicationTransform<TableDsl extends Table, D>(
  TableInfo<TableDsl, D> table, {
  required Insertable<D> Function(D row) transformInbound,
  required Insertable<D> Function(D row) transformOutbound,
  Insertable<D> Function(D)? toInsertable,
});