On Monday, 5 October 2020 at 13:30:22 UTC, Alaindevos wrote:
On Monday, 5 October 2020 at 11:35:43 UTC, Imperatorn wrote:
On Monday, 5 October 2020 at 08:47:45 UTC, Alaindevos wrote:
[...]

No, you just dub add dpq2

With dub.json:
"dependencies": {
                "dpq2": "~>1.0.17"
        },
It worked.
Something I ask myself is how do I pass a connection from one function to another.
...
string url=format("hostaddr='127.0.0.1' port='5432' dbname='%s' user='%s' password='%s'",db,user,pass);
 writeln(url);
Connection conn = new Connection(url);
auto answer = conn.exec("SELECT version()");
writeln(answer[0][0].as!PGtext);
...
myfunction(conn)

void myfunction( .... conn)
What is the type I should use for passing conn ?

Is this the first time you are trying D?

Reply via email to