question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

V6: Support for bind parameters

See original GitHub issue

There is a PR (https://github.com/sequelize/sequelize/pull/10284) for bind parameters on SELECT statements in sequelize, a crucial performance related feature. However, it is floundering.

I would like to propose to make this feature an explicit goal of v6. This way it gets the focus and priority it requires.

On a separate note, I think any sequelize version should have an umbrella task that allows debate on priorities and a checkable list of references to individual features.

Issue Description

Support bind parameters across the board

Is your feature request related to a problem? Please describe.

Bind parameters optimize performance and are an expected baseline for modern ORMs.

Describe the solution you’d like

Ideally, I would like bind parameters to be a global option that would allow you to have bind parameters use the already existing { someId: { [Op.eq]: var } style code, and a query specific option to override the default.

Alternatively, a different syntax could be considered (as is the case with Hibernate) to make the use case explicitly separate.

Why should this be in Sequelize

Performance. It is expected by people deciding on framework use.

Describe alternatives/workarounds you’ve considered

I’ve considered moving to TypeORM because of this. But I’m more familiar with sequelize and my code is in sequelize. I would pref it to be available on sequelize.

Is this issue dialect-specific?

  • No. This issue is relevant to Sequelize as a whole.
  • Yes. This issue only applies to the following dialect(s): XXX, YYY, ZZZ

Would you be willing to resolve this issue by submitting a Pull Request?

It’s already been done, but likely needs to be re-aligned.

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don’t know how to start, I would need guidance.
  • No, I don’t have the time, although I believe I could do it if I had the time…
  • No, I don’t have the time and I wouldn’t even know how to start.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ephyscommented, Apr 25, 2022

Properly supporting bind parameters is a priority of mine, I have a few bind-related tasks in my backlog.

With https://github.com/sequelize/sequelize/pull/14447 and https://github.com/sequelize/sequelize/pull/14020, we’ll be able to use bind parameters in many places easily like this:

User.findAll({
  where: { id: literal('$id') },
  bind: { id: 5 },
});

With more good things to follow such as caching queries using prepared statements & bind parameters, and specifying the type of a bind parameter.

A global option like in update and insert could follow if there is interest, but it’s incompatible with the planned API design for prepared statements.

1reaction
javierturycommented, Jan 25, 2020

I appreciate your interest for pull request #10284 about adding bind parameters. Unfortunately, during the last year I migrated all my projects to another sql library. The reason is that, despite all the effort and time I put on sequelize, I didn’t see any progress at all, which is frustrating.

You can still find the bind-params branch in my repo. Feel free to use it as a starting point, just keep in mind that it’s a little bit outdated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bind() parameters - IBM
Field is set to an IPv6 address and must be specified in network byte order. On hosts with more than one network interface...
Read more >
4. BIND 9 Configuration Reference
Matches the IPv4 and IPv6 addresses of all network interfaces on the system. When addresses are added or removed, the localhost ACL element...
Read more >
BIND 9.11.6 Options - IPAM Worldwide
Option name and syntax options view acache‑cleaning‑interval minutes yes yes acache‑enable (yes | no) yes yes additional‑from‑auth (yes | no) yes yes
Read more >
Support for complex bind parameters in template strings #575
It seems that simple types are allowed as bind parameters, but I can't easily pass in a serializable object or json. If I...
Read more >
Configure IPv6 for advanced users - Windows Server
Values other than 0 or 32 causes the Routing and Remote Access service to fail after this change takes effect. By default, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found