This repository has been archived by the owner on Aug 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw an error if the operator is unknown
Previously passing a query with an unknown operator would place the word "undefined" in the SQL query: ```javascript sequel.find('users', { balance: { 'in': [ 1, 2 ] } }); ``` ```sql 'SELECT "users"."id", "users"."email", "users"."balance", "users"."pickupCount" FROM "users" AS "users" "users"."balance" undefined ' ``` (Valid operators are things like 'contains', 'startsWith', 'endsWith', '>'.) This happens because we define the var `str` to be undefined, never set it, and then append it to the query string. Instead, immediately throw an error when an unknown key gets passed to Waterline, which should help diagnose these problems going forward (instead of forcing us to parse a Postgres syntax error). Cherry-picked from Shyp#6. Fixes #86.
- Loading branch information
Kevin Burke
committed
Mar 29, 2016
1 parent
998b9ef
commit ae8dfd0
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters