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 }}
Repository navigation
When selecting from users table in postgres, select statement generated tries to use reserved word 'user' #3528
I get the following stacktrace:
Executing (default): SELECT id, email, createdAt, updatedAt, deletedAt FROM Users AS User WHERE User.deletedAt IS NULL;
Possibly unhandled SequelizeDatabaseError: syntax error at or near "User"
Well in that case there is really nothing to do - you have told sequelize that you don't want quotes, so you're not getting any :)
quoteIdentifiers should really only be used in legacy situations where the table was created without quotes. When everything is handled by sequelize, quotes is your friend ;)
Ah, ok - that makes sense. I'm used to inspecting records via psql and was
weirded out by the quotes. Will re-enable and suck it up. Thanks!
On Tue, Apr 14, 2015 at 9:20 AM, Jan Aagaard Meier <[email protected]
wrote:
Well in that case there is really nothing to do - you have told sequelize
that you don't want quotes, so you're not getting any :)
quoteIdentifiers should really only be used in legacy situations where
the table was created without quotes. When everything is handled by
sequelize, quotes is your friend ;)
—
Reply to this email directly or view it on GitHub #3528 (comment)
.
Activity
janmeier commentedon Apr 14, 2015
Do you have quoteIdentifiers set to false? Otherwise User should automatically be quoted.
Which seqeulize version are you using?
alexduan commentedon Apr 14, 2015
Yes, I have set it to false so that table names are not created with quotes
(which is kind of weird on Postgres...).
On Tue, Apr 14, 2015 at 1:43 AM, Jan Aagaard Meier <[email protected]
janmeier commentedon Apr 14, 2015
Well in that case there is really nothing to do - you have told sequelize that you don't want quotes, so you're not getting any :)
quoteIdentifiersshould really only be used in legacy situations where the table was created without quotes. When everything is handled by sequelize, quotes is your friend ;)mickhansen commentedon Apr 14, 2015
@alexduan includes don't work with
quoteIdentifiers: falseso i'd reenable it.alexduan commentedon Apr 14, 2015
Ah, ok - that makes sense. I'm used to inspecting records via psql and was
weirded out by the quotes. Will re-enable and suck it up. Thanks!
On Tue, Apr 14, 2015 at 9:20 AM, Jan Aagaard Meier <[email protected]
PostgreSQL dialect: always quote identifier if it is a reverved word.…
feat(PostgreSQL dialect): always quote identifier if it is a reverved…
feat(PostgreSQL dialect): always quote identifier if it is a reserved…
feat(PostgreSQL dialect): always quote identifier if it is a reserved…