buggins / ddbc

DDBC is DB Connector for D language (similar to JDBC)
78 stars 45 forks source link

PostgreSQL. Unknown parameter of configuration : "autocommit" #22

Closed bubnenkoff closed 8 years ago

bubnenkoff commented 8 years ago

I am trying set up PG connection. Here is my code:

import std.stdio;
import std.conv;
import std.algorithm;
import std.datetime;
import std.path;
import std.file;

import ddbc.all;
import parseconfig;
import dbconnect;

ParseConfig config;

void main()
{
    config = new ParseConfig();

    PGSQLDriver driver = new PGSQLDriver();
    string url = PGSQLDriver.generateUrl(config.dbhost, to!short(config.dbport), config.dbname);

    string[string] params = PGSQLDriver.setUserAndPassword(config.dbuser, config.dbpass);

    DataSource ds = new ConnectionPoolDataSourceImpl(driver, url, params);

    auto conn = ds.getConnection();

}

Error massage:

ddbc.core.SQLException@C:\Users\bubenkov_di\AppData\Roaming\dub\packages\ddbc-0.
2.24\source\ddbc\drivers\pgsqlddbc.d(468): ╨Ю╨и╨Ш╨С╨Ъ╨Р:  ╨╜╨╡╤А╨░╤Б╨┐╨╛╨╖╨╜╨░╨╜
╨╜╤Л╨╣ ╨┐╨░╤А╨░╨╝╨╡╤В╤А ╨║╨╛╨╜╤Д╨╕╨│╤Г╤А╨░╤Ж╨╕╨╕: "autocommit"

----------------
0x0043A4C4 in bool std.exception.enforceEx!(ddbc.core.SQLException).enforceEx!(b
ool).enforceEx(bool, lazy immutable(char)[], immutable(char)[], uint) at C:\D\dm
d2\windows\bin\..\..\src\phobos\std\exception.d(618)
0x00426694 in int ddbc.drivers.pgsqlddbc.PGSQLStatement.executeUpdate(immutable(
char)[], out std.variant.VariantN!(20u).VariantN) at C:\Users\bubenkov_di\AppDat
a\Roaming\dub\packages\ddbc-0.2.24\source\ddbc\drivers\pgsqlddbc.d(468)
0x00426429 in int ddbc.drivers.pgsqlddbc.PGSQLStatement.executeUpdate(immutable(
char)[]) at C:\Users\bubenkov_di\AppData\Roaming\dub\packages\ddbc-0.2.24\source
\ddbc\drivers\pgsqlddbc.d(446)
0x0042398C in void ddbc.drivers.pgsqlddbc.PGSQLConnection.setAutoCommit(bool) at
 C:\Users\bubenkov_di\AppData\Roaming\dub\packages\ddbc-0.2.24\source\ddbc\drive
rs\pgsqlddbc.d(267)
0x0042309A in ddbc.drivers.pgsqlddbc.PGSQLConnection ddbc.drivers.pgsqlddbc.PGSQ
LConnection.__ctor(immutable(char)[], immutable(char)[][immutable(char)[]]) at C
:\Users\bubenkov_di\AppData\Roaming\dub\packages\ddbc-0.2.24\source\ddbc\drivers
\pgsqlddbc.d(166)
0x0042246E in ddbc.core.Connection ddbc.drivers.pgsqlddbc.PGSQLDriver.connect(im
mutable(char)[], immutable(char)[][immutable(char)[]]) at C:\Users\bubenkov_di\A
ppData\Roaming\dub\packages\ddbc-0.2.24\source\ddbc\drivers\pgsqlddbc.d(1217)
0x00423F27 in ddbc.core.Connection ddbc.common.DataSourceImpl.getConnection() at
 C:\Users\bubenkov_di\AppData\Roaming\dub\packages\ddbc-0.2.24\source\ddbc\commo
n.d(42)
0x0042259B in ddbc.core.Connection ddbc.common.ConnectionPoolDataSourceImpl.getC
onnection() at C:\Users\bubenkov_di\AppData\Roaming\dub\packages\ddbc-0.2.24\sou
rce\ddbc\common.d(116)
0x0040312D in _Dmain at D:\Project\2016\DBSync\source\app.d(29)
0x004CEB0B in D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x004CEACF in void rt.dmain2._d_run_main(int, char**, extern (C) int function(ch
ar[][])*).runAll()
0x004CE9D0 in _d_run_main
0x00421030 in main at D:\Project\2016\DBSync\source\app.d(7)
0x0051B9FD in mainCRTStartup
0x7668338A in BaseThreadInitThunk
0x77A99A02 in RtlInitializeExceptionChain
0x77A999D5 in RtlInitializeExceptionChain

PostgreSQL 9.5.1

buggins commented 8 years ago

It should be fixed in v0.2.33

Could you please confirm?