-
Notifications
You must be signed in to change notification settings - Fork 47
normalize params for postgres replaces literal question marks #216
Copy link
Copy link
Open
Description
db0/src/connectors/postgresql.ts
Lines 49 to 52 in 3c067b5
| 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels