crossJoin method

Query crossJoin(
  1. dynamic tableName, {
  2. dynamic tableColumn,
  3. dynamic baseColumn,
  4. dynamic baseTableCustom,
  5. Query function(
    1. Query
    )?,
})

Implementation

Query crossJoin(tableName, {tableColumn, baseColumn, baseTableCustom, Query Function(Query)? function}) {
  if (function != null) {
    _joinQuery += ' ( ';
    _joinQuery += ' CROSS JOIN  $tableName ON ';
    Query q = function(Query(table: baseTableCustom ?? table));
    _select += q._select;
    _joinQuery += q._joinQuery.replaceAll('{TABLE_COLUMN_FILL}', baseTableCustom ?? table) + ' ' + q._lastQuery.replaceAll('WHERE', 'AND');
  } else {
    _joinQuery += ' CROSS JOIN $tableName ON ';
    _joinQuery += tableName + '.' + tableColumn + '=' + (baseTableCustom ?? table) + '.' + baseColumn;
  }
  return this;
}