{"action":"opened","issue":{"url":"https://api.github.com/repos/buggins/ddbc/issues/15","labels_url":"https://api.github.com/repos/buggins/ddbc/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/buggins/ddbc/issues/15/comments","events_url":"https://api.github.com/repos/buggins/ddbc/issues/15/events","html_url":"https://github.com/buggins/ddbc/issues/15","id":121959515,"number":15,"title":"How to access prepared statemetns on the DB Server?","user":{"login":"KoreyPeters","id":15987051,"avatar_url":"https://avatars.githubusercontent.com/u/15987051?v=3","gravatar_id":"","url":"https://api.github.com/users/KoreyPeters","html_url":"https://github.com/KoreyPeters","followers_url":"https://api.github.com/users/KoreyPeters/followers","following_url":"https://api.github.com/users/KoreyPeters/following{/other_user}","gists_url":"https://api.github.com/users/KoreyPeters/gists{/gist_id}","starred_url":"https://api.github.com/users/KoreyPeters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KoreyPeters/subscriptions","organizations_url":"https://api.github.com/users/KoreyPeters/orgs","repos_url":"https://api.github.com/users/KoreyPeters/repos","events_url":"https://api.github.com/users/KoreyPeters/events{/privacy}","received_events_url":"https://api.github.com/users/KoreyPeters/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-14T01:41:02Z","updated_at":"2015-12-14T01:41:02Z","closed_at":null,"body":"Hi. I'm having trouble figuring out how to access a prepared statement already on the PostGres server.\r\n\r\nMy d code is:\r\n```\r\n    auto stmt = conn.createStatement();\r\n    scope(exit) stmt.close();\r\n    auto rs = stmt.executeQuery(format(\"SELECT create_step(%d, '%s', %d);\", parentId, name, rank));\r\n    scope(exit) rs.close();\r\n```\r\n\r\nMy stored procedure is:\r\n```\r\n-- Function: create_step(integer, character varying, integer)\r\n\r\n-- DROP FUNCTION create_step(integer, character varying, integer);\r\n\r\nCREATE OR REPLACE FUNCTION create_step(new_parent_id integer, new_name character varying, new_rank integer)\r\n  RETURNS step AS\r\n$BODY$\r\n\r\nDECLARE\r\n\tcreated_step step%ROWTYPE;\r\nBEGIN\r\n\tUPDATE steps SET rank = rank + 1 WHERE parent_id = new_parent_id AND rank >= new_rank;\r\n\t\r\n\tINSERT INTO steps (parent_id, name, rank)\r\n\tVALUES (new_parent_id, new_name, new_rank) \r\n\tRETURNING id, parent_id, name, rank INTO created_step;\r\n\tRETURN created_step;\r\nEND\r\n$BODY$\r\n  LANGUAGE plpgsql VOLATILE\r\n  COST 100;\r\nALTER FUNCTION create_step(integer, character varying, integer)\r\n  OWNER TO postgres;\r\n```\r\n\r\nAnd the stack trace is:\r\n```\r\nddbc.core.SQLException@../../.dub/packages/ddbc-0.2.24/source/ddbc/drivers/pgsqlddbc.d(401): Unsupported column type 16563\r\n----------------\r\n../../.dub/packages/ddbc-0.2.24/source/ddbc/drivers/pgsqlddbc.d:401 void ddbc.drivers.pgsqlddbc.PGSQLStatement.fillData(ddbc.drivers.pgsql.PGresult*, ref std.variant.VariantN!(32uL).VariantN[][]) [0x72576c]\r\n../../.dub/packages/ddbc-0.2.24/source/ddbc/drivers/pgsqlddbc.d:443 ddbc.core.ResultSet ddbc.drivers.pgsqlddbc.PGSQLStatement.executeQuery(immutable(char)[]) [0x725a6c]\r\nsource/storage.d:79 models.Step storage.PostGresStorage.createStep(int, immutable(char)[], int) [0x71ef98]\r\nsource/app.d:38 models.Step app.MyAPIImplementation.createStep(int, immutable(char)[], int) [0x6e748e]\r\nsource/app.d:44 void app.MyAPIImplementation.__unittestL41_1() [0x6e7539]\r\n```\r\n\r\nI feel like there's some example or documentation I'm missing. I can call a non-parameterized stored procedure with\r\n```\r\nauto rs = stmt.executeQuery(\"SELECT create_step_table()\");\r\n```"}}