Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter storage class affects the PGType #48

Open
tapg24 opened this issue Nov 7, 2015 · 0 comments
Open

Parameter storage class affects the PGType #48

tapg24 opened this issue Nov 7, 2015 · 0 comments

Comments

@tapg24
Copy link

tapg24 commented Nov 7, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant