|
function normalizeParams(sql: string) { |
|
let i = 0; |
|
return sql.replace(/\?/g, () => `$${++i}`); |
|
} |
see also nuxt/content#3682
this method attempts to normalise ? params for postgres, but ends up replacing literal question marks too
i came across this when using nuxt/content and my markdown files had $1, $2, ... where question marks should have been
of course, nuxt/content uses sqlite by default during local development so i didn't discover this until i saw the page in production :)
anyways, i think the fix here is to beef up normalizeParams to detect exactly the ? which are params and leave literal question marks alone
db0/src/connectors/postgresql.ts
Lines 49 to 52 in 3c067b5
see also nuxt/content#3682
this method attempts to normalise
?params for postgres, but ends up replacing literal question marks tooi came across this when using
nuxt/contentand my markdown files had$1,$2, ... where question marks should have beenof course,
nuxt/contentuses sqlite by default during local development so i didn't discover this until i saw the page in production :)anyways, i think the fix here is to beef up normalizeParams to detect exactly the
?which are params and leave literal question marks alone