Skip to content

Parameter storage class affects the PGType #48

@tapg24

Description

@tapg24

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions