mapResultRowToRelation<DataType extends DataObject<DataType> > function
DataType
mapResultRowToRelation<DataType extends DataObject<DataType> >(
- PostgresqlRelation relation,
- DataBean<
DataType> bean, - 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),
});
}