toSql method

String toSql()

Implementation

String toSql() {
  String sql = 'ON $_column1 = $_column2';

  if (_whereClause.wheres.isNotEmpty) {
    if (_whereClause.wheres.first.condition == QueryCondition.and) {
      sql += ' AND ';
    } else if (_whereClause.wheres.first.condition == QueryCondition.or) {
      sql += ' OR ';
    }

    sql += _whereClause.toSql();
  }

  return sql;
}