ddb icon indicating copy to clipboard operation
ddb copied to clipboard

Parameter storage class affects the PGType

Open tapg24 opened this issue 9 years ago • 0 comments

Good: Nullable!User getUser(int _user_id) { auto conn = m_pgdb.lockConnection(); auto cmd = new PGCommand(conn, "SELECT user_id, username, email FROM users WHERE user_id = $1;"); cmd.parameters.add(1, PGType.INT4).value = _user_id; .. }

Exception: Nullable!User getUser(in int _user_id) { auto conn = m_pgdb.lockConnection(); auto cmd = new PGCommand(conn, "SELECT user_id, username, email FROM users WHERE user_id = $1;"); cmd.parameters.add(1, PGType.INT4).value = _user_id; .. }

ddb.postgres.ParamException@C:\Users\pavel\AppData\Roaming\dub\packages\ddb-0.2.3\source\ddb\postgres.d(842): Parameter's value is not convertible to int

tapg24 avatar Nov 07 '15 09:11 tapg24