我有以下原始查询
final maps = await db.rawQuery("""
select r.id, r.name, r.description,r.created_by,
a.id,a.name,a.description from Resources r
left join Resource_Attribute ra on ra.resource_id = r.id
left join AttributeItems a on ra.attribute_id=a.id
""");
Run Code Online (Sandbox Code Playgroud)
我的问题是如何从查询中的所有列中检索数据?执行以下操作
maps.forEach((dbItem){
String resourceId = dbItem["r.id"];
Run Code Online (Sandbox Code Playgroud)
似乎不起作用。 dbItems是一个映射,但仅包含Resources表中的四列。dbItem["r.id"] 返回 null。
dbItems 确实包含一个“行”字段,它是一个包含所有字段的数组。有办法访问它吗?