whereNotHas method
Implementation
Query whereNotHas(tableName, Query Function(Query)? function) {
if (!_lastQuery.contains('WHERE')) {
_lastQuery += ' WHERE ';
} else {
_lastQuery += ' AND ';
}
String has = ' NOT EXISTS ( ';
if (function != null) {
Query q = function(Query(table: tableName));
has += 'SELECT ${q._select == '' ? '*' : q._select} FROM $tableName ' + q._joinQuery + ' ' + q._lastQuery;
}
has += ' ) ';
_lastQuery += has + ' ';
return this;
}