-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
LIKE ANY ARRAY syntax error using PostgreSQL #5736
Description
What you are doing?
Using this query:
{
where: {
commonnames: {
'$like': {
$any: ["c%", "%,c%"]
}
}
}
}
on a table called fishes, I get this query:
Executing (default): SELECT "id", "species", "genusId", "commonnames", "createdAt", "updatedAt" FROM "fishes" AS "fish" WHERE "fish"."commonnames" LIKE ANY ARRAY['%c%','%,c%'] LIMIT 1;
which produces this syntax error:
Unhandled rejection SequelizeDatabaseError: syntax error at or near "ARRAY"
at Query.formatError (/var/node/fishambiguator/node_modules/sequelize/lib/dialects/postgres/query.js:347:14)
at null. (/var/node/fishambiguator/node_modules/sequelize/lib/dialects/postgres/query.js:81:19)
at emit (events.js:107:17)
at Query.handleError (/var/node/fishambiguator/node_modules/pg/lib/query.js:108:8)
at null. (/var/node/fishambiguator/node_modules/pg/lib/client.js:171:26)
at emit (events.js:107:17)
at Socket. (/var/node/fishambiguator/node_modules/pg/lib/connection.js:109:12)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
using PostgreSQL.
What do you expect to happen?
A successful query
What is actually happening?
The above error
Dialect: postgres
Database version: PostgreSQL 9.3.10 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit
Sequelize version: "sequelize": "^3.14.1"