Using Postgres connection functions

Joe jma at freedomcircle.com
Sat Jan 13 04:34:28 UTC 2018


On Saturday, 13 January 2018 at 04:26:06 UTC, Adam D. Ruppe wrote:
> If and only if the values are known at compile time, you can do:
>
> const char** keywords = ["hostaddr".ptr, "port".ptr, 
> "dbname".ptr, null].ptr;
>
> or even do it inline:
>
>
> PQconnectdbParams(["hostaddr".ptr, "port".ptr, "dbname".ptr, 
> null].ptr, ditto_for_values, 1);

The keywords are (or could be) known at compile time, but almost 
by definition, the associated values are only known at runtime.



More information about the Digitalmars-d-learn mailing list