diff --git a/examples/pgsql_test/source/main.d b/examples/pgsql_test/source/main.d index b51888f..dafbc73 100644 --- a/examples/pgsql_test/source/main.d +++ b/examples/pgsql_test/source/main.d @@ -79,5 +79,18 @@ int main(string[] argv) ubyte[] res = rs2.getUbytes(2); assert(res == bin_data); } + + stmt.executeUpdate("DROP TABLE IF EXISTS guidtest"); + stmt.executeUpdate("CREATE TABLE guidtest (guid uuid not null primary key, name text)"); + stmt.executeUpdate("INSERT INTO guidtest (guid, name) VALUES ('cd3c7ffd-7919-f6c5-999d-5586d9f3b261', 'vasia')"); + struct Guidtest { + string guid; + string name; + } + Guidtest[] guidrows; + foreach(e; stmt.select!Guidtest) + guidrows ~= e; + writeln(guidrows); + return 0; } diff --git a/source/ddbc/drivers/pgsqlddbc.d b/source/ddbc/drivers/pgsqlddbc.d index 9a5ce73..c6d7070 100644 --- a/source/ddbc/drivers/pgsqlddbc.d +++ b/source/ddbc/drivers/pgsqlddbc.d @@ -559,6 +559,9 @@ version(USE_PGSQL) { case DATEOID: v[col] = parseDateoid(s); break; + case UUIDOID: + v[col] = s; + break; default: throw new SQLException("Unsupported column type " ~ to!string(t)); }