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

INSERT with parameters fails if less than 3 parameters #78

Open
wallisch opened this issue Jan 22, 2021 · 2 comments
Open

INSERT with parameters fails if less than 3 parameters #78

wallisch opened this issue Jan 22, 2021 · 2 comments

Comments

@wallisch
Copy link

I've just encountered a very strange bug, which took me hours to figure out.

Apparently, if you execute an INSERT statement with parameters, it only works if the passed object contains more than 2 properties.

Fails with "cannot find parameter color_id";

dataAPI.query(
        `INSERT INTO component (color_id, name) 
        VALUES(:color_id, :name)` ,{ 
            color_id: 1,
            name: "test"
})

Passes:

dataAPI.query(
        `INSERT INTO component (color_id, name) 
        VALUES(:color_id, :name)` ,{ 
            color_id: 1,
            name: "test",
            dummy: "dummy"
})

Unfortunately I have no idea what causes this.

@ffxsam ffxsam closed this as completed Jan 22, 2021
@ffxsam ffxsam reopened this Jan 22, 2021
@ffxsam
Copy link
Collaborator

ffxsam commented Jan 22, 2021

@jeremydaly This is probably a semi-critical bug. It was fixed in PR #75 but hasn't been published to the npm registry, looks like.

@lucas-subli
Copy link

lucas-subli commented Jul 15, 2021

+1

Why is this not on NPM yet?

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

3 participants