Skip to content

Commit b1e5030

Browse files
committed
fix postgresql autocommit issue - buggins#22 buggins#29
1 parent ac57da9 commit b1e5030

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

examples/pgsql_test/source/main.d

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import std.stdio;
22

33
import ddbc.all;
4+
import ddbc.pods;
45

56
int main(string[] argv)
67
{
@@ -65,6 +66,14 @@ int main(string[] argv)
6566
PreparedStatement ps = conn.prepareStatement("INSERT INTO bintest (id, blob1) VALUES (1, ?)");
6667
ps.setUbytes(1, bin_data);
6768
ps.executeUpdate();
69+
struct Bintest {
70+
long id;
71+
ubyte[] blob1;
72+
}
73+
Bintest[] rows;
74+
foreach(e; stmt.select!Bintest)
75+
rows ~= e;
76+
//stmt!
6877
auto rs2 = stmt.executeQuery("SELECT id, blob1 FROM bintest WHERE id=1");
6978
if (rs2.next()) {
7079
ubyte[] res = rs2.getUbytes(2);

source/ddbc/drivers/pgsqlddbc.d

+3-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ version(USE_PGSQL) {
418418
lock();
419419
scope(exit) unlock();
420420

421-
assert(0, "AUTOCOMMIT is no longer supported.");
421+
autocommit = true;
422+
423+
//assert(0, "AUTOCOMMIT is no longer supported.");
422424
}
423425
}
424426

0 commit comments

Comments
 (0)