You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Beer
{
public int ID;
public IList<Glass> Glasses;
}
CREATE PROC GetBeerAndPossibleGlasses AS
SELECT * FROM Beer
SELECT b.BeerID, g.* FROM Beer JOIN Glasses ON (...)
while most SQL are written like
SELECT * FROM Beer LEFT JOIN Glasses ON (...)
I'm thinking that we create a new record reader:
Keep a dictionary of parentid/parent.
Read a record.
Look up the parentid and see if we need to create a new instance or reuse an existing.
Add child to the parent using the parent/child relationship.
This will probably stream acceptably.
This project will require:
New record reader
Record reader Test cases
Possible adjustment to the Recordset attributes for interface building
Update the interface builder to use the new record reader
Interface test cases
Update documentation / samples
The text was updated successfully, but these errors were encountered:
The magic to make parent/child records get parsed from the same recordset is:
var results = Connection().QuerySql(query, parameters,
Query.Returns(Together<Parent, Child>.Records));
Using Together instead of Some alters the parsing so that the recordset is parsed, child records are grouped, and the list of unique parent records are returned.
This is compatible with all of the structure declarations, like returning two recordsets:
Finally, you can use parent/child processing in interface definitions. Setting IsParentAndChild=true on the Recordset attribute tells Insight to use Together Rather than Some when parsing the records.
See if we can automatically handle deserializing the common query pattern of:
Example from Issue #375:
I'm thinking that we create a new record reader:
This will probably stream acceptably.
This project will require:
Recordset
attributes for interface buildingThe text was updated successfully, but these errors were encountered: