createOrReplaceOplogTrigger method

List<String> createOrReplaceOplogTrigger(
  1. SqlOpType opType,
  2. QualifiedTablename table,
  3. String newPKs,
  4. String newRows,
  5. String oldRows,
)

Implementation

List<String> createOrReplaceOplogTrigger(
  SqlOpType opType,
  QualifiedTablename table,
  String newPKs,
  String newRows,
  String oldRows,
) {
  final namespace = table.namespace;
  final tableName = table.tablename;

  return [
    dropTriggerIfExists(
      '${opType.text.toLowerCase()}_${namespace}_${tableName}_into_oplog',
      table,
    ),
    ...createOplogTrigger(
      opType,
      table,
      newPKs,
      newRows,
      oldRows,
    ),
  ];
}