Skip to content

Commit

Permalink
fix postgresql autocommit issue - #22 #29
Browse files Browse the repository at this point in the history
  • Loading branch information
buggins committed Sep 21, 2016
1 parent ac57da9 commit b1e5030
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions examples/pgsql_test/source/main.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import std.stdio;

import ddbc.all;
import ddbc.pods;

int main(string[] argv)
{
Expand Down Expand Up @@ -65,6 +66,14 @@ int main(string[] argv)
PreparedStatement ps = conn.prepareStatement("INSERT INTO bintest (id, blob1) VALUES (1, ?)");
ps.setUbytes(1, bin_data);
ps.executeUpdate();
struct Bintest {
long id;
ubyte[] blob1;
}
Bintest[] rows;
foreach(e; stmt.select!Bintest)
rows ~= e;
//stmt!
auto rs2 = stmt.executeQuery("SELECT id, blob1 FROM bintest WHERE id=1");
if (rs2.next()) {
ubyte[] res = rs2.getUbytes(2);
Expand Down
4 changes: 3 additions & 1 deletion source/ddbc/drivers/pgsqlddbc.d
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ version(USE_PGSQL) {
lock();
scope(exit) unlock();

assert(0, "AUTOCOMMIT is no longer supported.");
autocommit = true;

//assert(0, "AUTOCOMMIT is no longer supported.");
}
}

Expand Down

0 comments on commit b1e5030

Please sign in to comment.