mapResultRowToRelation<DataType extends DataObject<DataType>> function

DataType mapResultRowToRelation<DataType extends DataObject<DataType>>(
  1. PostgresqlRelation relation,
  2. DataBean<DataType> bean,
  3. ResultRow row
)

Implementation

DataType mapResultRowToRelation<DataType extends DataObject<DataType>>(
  PostgresqlRelation relation,
  DataBean<DataType> bean,
  pg.ResultRow row,
) {
  final decoderMapping = _buildDecoderMapping(
    relation.attributes.whereType<PostgresqlDataAttribute>(),
    row.schema,
  );
  return bean.fromValues({
    for (final (fieldName, decode) in decoderMapping.tuples)
      fieldName: decode(row),
  });
}