You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 25, 2022. It is now read-only.
This causes a parse error in my sql query. Consider the following example:
CREATETABLEthing(
tags string[] NOT NULL
)
constformat=require('pg-format')format('INSERT INTO %I (%I) VALUES(%L)','thing','tags',[])
Now this get's formatted into the following query:
INSERT INTO thing (tags) VALUES()
Which gives the following error:
error: syntax error at or near ")"
I believe that the correct query output would have been:
INSERT INTO thing (tags) VALUES('{}')
A workaround is to send in the string '{}' to the format function, but that is very ugly and breaks my validation of data since it expects an array of strings...