reusing placeholders

Is it possible to reuse placeholders with the same value instead of passing them to the driver every time they're referenced?

Simply giving them the same name doesn't seem work. Drizzle creates a separate SQL parameter for each placeholder regardless.

Example


This is what Query#params looks like after referencing two placeholders multiple times.

[
  Placeholder {
    name: "warningTimestamp",
    getSQL: [Function: getSQL],
  }, Placeholder {
    name: "warningTimestamp",
    getSQL: [Function: getSQL],
  }, Placeholder {
    name: "userId",
    getSQL: [Function: getSQL],
  }, Placeholder {
    name: "warningTimestamp",
    getSQL: [Function: getSQL],
  },
  ...
]
Was this page helpful?