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 Sep 8, 2023. It is now read-only.
Expected behavior: escape.ident('Foo') === '"Foo"'
Actual behavior: escape.ident('Foo') === 'Foo'
If we had pool.query(`CREATE DATABASE ${escape.ident(name)}`), and name is 'Foo', the created database would have the name foo instead since Postgres lowercases unquoted identifiers.
I'm not even sure if name.toLowerCase() !== name would be a sufficient to decide whether to quote because who knows if JS lowercases all the same non-Latin characters as Postgres does? I think the safest bet would be to add double quotes if the name doesn't match /^[a-z_][a-z0-9_$]*$/ (case sensitive)