keyToSQL method

Implementation

FutureOr<MapEntry<Type, String>> keyToSQL(
    KeyCondition<dynamic, dynamic> c, EncodingContext context) {
  var keys = c.keys;

  if (keys.first is! ConditionKeyField) {
    throw ConditionEncodingError('Root Key should be a field key: $c');
  }

  if (keys.length == 1) {
    return keyFieldToSQL(c, context);
  } else if (keys.length == 2) {
    return keyFieldReferenceToSQL(c, context);
  } else {
    throw ConditionEncodingError('keys > 2: $c');
  }
}