question on dub and postgresql

Alaindevos devosalain at ymail.com
Mon Oct 5 14:40:12 UTC 2020


Just Connection worked.
But how do I loop over results of a select statement.
string sql=format(" SELECT * from %s ;",tablepredata);
auto answer = conn.exec(sql);
foreach(arow; answer){
	writeln(arow);
}
Fails with,
dub ~master: building configuration "application"...
source/app.d(36,3): Error: invalid foreach aggregate answer, 
define opApply(), range primitives, or use .tupleof
/usr/local/bin/ldc2 failed with exit code 1.




More information about the Digitalmars-d-learn mailing list