Created
July 25, 2014 18:42
-
-
Save danfinlay/7f669be8665adc646ce2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| geddy.model.log = console.log; | |
| geddy.model.User.all({'newsPosts.body':{like:'%Lorem%'}} | |
| , {includes:'NewsPost'} | |
| , function(err, users){ | |
| console.log(err); | |
| console.log(users); | |
| }); |
This file contains hidden or 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
| SELECT"users"."id" AS "User#id", "users"."created_at" AT TIME ZONE 'UTC' AS "user#createdAt", "users"."updated_at" AT TIME ZONE 'UTC' AS "user#updatedAt","user#newsPost"."id" AS "user#newsPost#id", "user#newsPost"."created_at" AT TIME ZONE 'UTC' AS "user#newsPost#createdAt", "user#newsPost"."updated_at" AT TIME ZONE 'UTC' AS "user#newsPost#updatedAt", "user#newsPost"."body" AS "user#newsPost#body", "user#newsPost"."user_id" AS "user#newsPost#userId", "user#newsPost"."user_id" AS "user#newsPost#userId" | |
| FROM users users | |
| LEFT OUTER JOIN "newsPosts" "user#newsPost" ON ("users"."id" = "User#newsPost"."user_id") | |
| WHERE ("user#newsPosts"."body" LIKE '%Lorem%') | |
| ORDER BY users."id" ASC | |
| ; |
This file contains hidden or 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
| error: missing FROM-clause entry for table "User#newsPosts" | |
| at Connection.parseE (/Project/node_modules/pg/lib/connection.js:561:11) | |
| at Connection.parseMessage (/Project/node_modules/pg/lib/connection.js:390:17) | |
| (See full trace by running task with --trace) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment