Need example of usage DerelictPQ

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 28 00:41:13 PST 2014


Adam, I trying to build simple app:

import std.stdio;
import postgres;
import database;

void main() {
	auto db = new PostgreSql("dbname = test2");

	foreach(line; db.query("SELECT * FROM customer")) {
		writeln(line[0], line["customer_id"]);
	}
}

and getting next error:

D:\123>dmd app.d database.d postgres.d
postgres.d(124): Error: struct database.Row member resultSet is 
not accessible
postgres.d(139): Error: struct database.Row member row is not 
accessible


Also I can't understand why I do not need specify login and pass 
when I connection to DB?


More information about the Digitalmars-d-learn mailing list