New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Postgres' ability to search within functions. #879

Merged
merged 1 commit into from Sep 3, 2013

Conversation

3 participants
@durango
Member

durango commented Sep 3, 2013

This is a pure and simple fix for searching with a Postgres' array column type.
This commit changes hashToWhereConditions by adding a second argument of sending
the factory's details over and checking for column type if the hash/value/first
argument is an array. For the actual search we just utilize a simple overlap &&
boolean search.

Fixes Postgres' ability to search within functions.
This is a pure and simple fix for searching with a Postgres' array column type.
This commit changes hashToWhereConditions by adding a second argument of sending
the factory's details over and checking for column type if the hash/value/first
argument is an array. For the actual search we just utilize a simple overlap &&
boolean search.

janmeier added a commit that referenced this pull request Sep 3, 2013

Merge pull request #879 from durango/anyarray
Fixes Postgres' ability to search within functions.

@janmeier janmeier merged commit 1c6255d into sequelize:master Sep 3, 2013

1 check passed

default The Travis CI build passed
Details
@domasx2

This comment has been minimized.

Contributor

domasx2 commented on lib/dialects/postgres/query-generator.js in 352f78d Sep 3, 2013

If column is not of type ARRAY, clause is not handled and nothing is added to result. This breaks searching for records where an attribute that is not of type array is expected to be in a list of values, eg:

User.findAll({
  where: {
    id: [1, 2]
  }
});

Will result in invalid SQL, no where clause.
Added a test & a fix to pull request #880

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment