GithubHelp home page GithubHelp logo

Comments (4)

lucas-subli avatar lucas-subli commented on July 17, 2024 1

After hours and hours on the same problem here is the fix:

DO NOT pass two params, pass 1 or 3+
Any query with 2 params will fail

await rds.query('update users set name = :name where email = :email', { name: 'Test User', email: '[email protected]', dummy: 'dummy' });

Should work.
There seems to be a fix on master that has not been uploaded to NPM yet.

from data-api-client.

brian-learningpool avatar brian-learningpool commented on July 17, 2024

I've just stumbled upon the same bug. Any ideas when this will be patched on NPM?

from data-api-client.

mrbayrmagnai avatar mrbayrmagnai commented on July 17, 2024

Don't use name, value, cast as property name of params. These keywords are already used in library for other purposes.

await rds.query('update users set name = :cu_name where email = :email', { cu_name : 'Test User', email: '[email protected]' });

Should work

from data-api-client.

jansila avatar jansila commented on July 17, 2024

Oh, it was driving me mad for an hour, because I have a table with columns note, name and the error for query
await db.query(`INSERT INTO InternalNotes (note, name) VALUES ( :note, :name);`, props)
is BadRequestException: Cannot find parameter: note, so that was quite confusing as to what is going on.

from data-api-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.