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
I am attempting to use the postgres citext module with Sequelize, so far it has worked well by using literals for queries and defining the type in the model. However because Sequelize does not understand what the citext type is, it returns my citext arrays as strings. e;g "{item 1, item2}"
To get around this I am trying to cast the citext array to a TEXT or VARCHAR array in the query, however when I do this, Sequelize does not show that field at all.
If I set raw: true, the field shows fine, and as an array.
I am attempting to use the postgres citext module with Sequelize, so far it has worked well by using literals for queries and defining the type in the model. However because Sequelize does not understand what the citext type is, it returns my citext arrays as strings. e;g "{item 1, item2}"
To get around this I am trying to cast the citext array to a TEXT or VARCHAR array in the query, however when I do this, Sequelize does not show that field at all.
If I set raw: true, the field shows fine, and as an array.
What do you expect to happen?
I expect there to be a nicknames field returned from sequelize and it to be an array, instead it's as if the attribute is not there at all.
What is actually happening?
This is the generated SQL, the SQL itself works fine when I try it in a database manager, but the output Sequelize gives me omits the nickname field.
SELECT "User"."id", "User"."createdAt", "User"."updatedAt", CAST("nicknames" AS TEXT[]) FROM "Users" AS "User" WHERE "User"."deletedAt" IS NULL;
Dialect: postgres
Database version: 9.5
Sequelize version: 3.23.4
The text was updated successfully, but these errors were encountered: