exists method
Returns true if a row with the SQL id exists in the database.
This method queries the mapping table to find out whether it has a row
that can be identified by either the SqlId.rowid or SqlId.keyid of the
given SQL id.
Implementation
bool exists(SqlId id) {
checkActive();
ResultSet result;
if (id.hasRowId)
result = _existsByRowId!.select([id.rowid]);
else
result = _existsByKeyId!.select(<Object>[id.keyid!]);
checkState(result.length == 1);
int count = result.first.columnAt(0) as int;
checkState(count == 0 || count == 1);
return count == 1;
}