SQLEntry constructor

SQLEntry(
  1. String type,
  2. String sql, {
  3. String? comment,
  4. List<String>? tables,
  5. List<String>? referenceTables,
  6. List<SQLColumn>? columns,
})

Implementation

SQLEntry(this.type, this.sql,
    {String? comment,
    List<String>? tables,
    List<String>? referenceTables,
    this.columns})
    : comment = comment != null && comment.isNotEmpty ? comment : null,
      tables = tables ??
          columns?.map((e) => e.table).whereNotNull().toSet().toList(),
      referenceTables = referenceTables ??
          columns
              ?.map((e) => e.referenceTable)
              .whereNotNull()
              .toSet()
              .toList();