Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Numbered parameters in postgres flavour are substituted inside a string literal #373

Open
terazoid opened this issue Dec 10, 2018 · 0 comments

Comments

@terazoid
Copy link

After sql is genereted, code inside if (options.numberedParameters) replaces all options.parameterCharacter occurrences with named parameters, even if options.parameterCharacter is inside a string literal.

To reproduce this bug you can use the following code:

const squel = require('squel').useFlavour('postgres');

let q = squel.update()
    .table('table')
    .set('a', '?');
console.log(q.toString());

Expected: UPDATE table SET a = '?'
Got: UPDATE table SET a = '$1'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant