Skip to content

WIP: allow named parameters in queries #125

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

Closed
wants to merge 2 commits into from
Closed

Conversation

sidorares
Copy link
Owner

Currently only for server-side processed parameters. Named to unnamed happens on the client if namedParameters flag is set to true:

   db.execute("select foo from bar where id > :id", { id: 123 }, callback);
   // is the same as
   db.execute("select foo from bar where id > ?", [123], callback)

@sidorares sidorares added this to the 0.15.0 milestone Jan 9, 2015
@sidorares sidorares closed this Jan 9, 2015
@sidorares sidorares deleted the named-parameters branch January 16, 2016 04:22
@mnpenner
Copy link

Did you redact this feature? It'd be really nice to have 😄

@sidorares
Copy link
Owner Author

It's in for quite some time. Do you have any issues or need help with the feature @mnpenner ?

@mnpenner
Copy link

@sidorares Apparently I do need help. I ran a search on the codebase for namedParameters and didn't find any references.

Oh... I see, it's been renamed namedPlaceholders hasn't it? I'll try this out, thanks 😄

@sidorares
Copy link
Owner Author

yes, it was renamed ( readme is referring to a correct name )

Actually it might be a good idea to throw error if unknown config key is passed to save time debugging typos

@mnpenner
Copy link

Probably wouldn't hurt 😄

namedPlaceholders works as expected. Thanks!!

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

Successfully merging this pull request may close these issues.

2 participants