getWhere<TDef extends ITableDefinition> function

SqlRequest getWhere<TDef extends ITableDefinition>(
  1. Where where(
    1. TDef e
    )?,
  2. TDef tableDefinition
)

'where' clause

Implementation

SqlRequest getWhere<TDef extends ITableDefinition>(
  Where Function(TDef e)? where,
  TDef tableDefinition,
) {
  if (where != null) {
    var whereObj = where(tableDefinition);
    var whereClauseCalculator = WhereClauseCalculator();
    return whereClauseCalculator //
        .getWhereFromCommand(whereObj)
        .prependSql("where ");
  } else {
    return SqlRequest("", {});
  }
}