createCommand method

String createCommand()
override
the text of the sql command that will create the object in the database

Implementation

String createCommand() {
  StringBuffer sb = new StringBuffer();
  sb.write('CREATE TRIGGER `${this._name}` ${_before ? "BEFORE" : "AFTER"} ${_events[_event.index]} ON `${_tbl.name}`');
  sb.write(" FOR EACH ROW ");
  sb.write(" WHEN (${_when.toSql(null)}) BEGIN");

  sb.writeAll(_triggerSteps.map((t) => t.toSql()), " ; ");

  sb.write(" END");
  //
  return sb.toString();
}