toSql method

String toSql()

Implementation

String toSql() {
  String sql = '';

  for (var where in wheres) {
    if (where == wheres.first) {
      sql += where.toSql();
    } else {
      if (where.condition == QueryCondition.and) {
        sql += ' AND ';
      } else if (where.condition == QueryCondition.or) {
        sql += ' OR ';
      }

      sql += where.toSql();
    }
  }

  return sql;
}