{"action":"created","comment":{"url":"https://api.github.com/repos/slick/slick/pulls/comments/24253872","id":24253872,"diff_hunk":"@@ -190,10 +190,29 @@ object LiftedEmbedding extends App {\n       //   select \"COF_NAME\", \"SUP_ID\", \"PRICE\", \"SALES\", \"TOTAL\"\n       //     from \"COFFEES\"\n       //     order by \"COF_NAME\" desc nulls first\n+      \n+      // building criteria using a \"dynamic filter\" e.g. from a webform. \n+      val criteriaColombian = Option(\"Colombian\")\n+      val criteriaEspresso = Option(\"Espresso\")\n+      val criteriaRoast:Option[String] = None\n+\n+      val q4 = coffees.map(_.name).filter { coffee => \n+        List(\n+            criteriaColombian.map(coffee.name === _),\n+            criteriaEspresso.map(coffee.name === _),\n+            criteriaRoast.map(coffee.name === _) // not a condition as `criteriaRoast` evaluates to `None` \n+        ).collect({case Some(criteria)  => criteria}).reduceLeftOption(_ || _).getOrElse(true:Column[Boolean])\n+      }\n+      // compiles to SQL (simplified):\n+      //   select \"COF_NAME\"","path":"src/sphinx/code/LiftedEmbedding.scala","position":18,"original_position":18,"commit_id":"a284e5f353a1142a1532c856bdc4fa77ec788664","original_commit_id":"a284e5f353a1142a1532c856bdc4fa77ec788664","user":{"login":"cvogt","id":274947,"avatar_url":"https://avatars.githubusercontent.com/u/274947?v=3","gravatar_id":"","url":"https://api.github.com/users/cvogt","html_url":"https://github.com/cvogt","followers_url":"https://api.github.com/users/cvogt/followers","following_url":"https://api.github.com/users/cvogt/following{/other_user}","gists_url":"https://api.github.com/users/cvogt/gists{/gist_id}","starred_url":"https://api.github.com/users/cvogt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvogt/subscriptions","organizations_url":"https://api.github.com/users/cvogt/orgs","repos_url":"https://api.github.com/users/cvogt/repos","events_url":"https://api.github.com/users/cvogt/events{/privacy}","received_events_url":"https://api.github.com/users/cvogt/received_events","type":"User","site_admin":false},"body":"And change this to `select \"COF_NAME\", \"SUP_ID\", \"PRICE\", \"SALES\", \"TOTAL\"`","created_at":"2015-02-06T16:53:29Z","updated_at":"2015-02-06T16:53:29Z","html_url":"https://github.com/slick/slick/pull/1067#discussion_r24253872","pull_request_url":"https://api.github.com/repos/slick/slick/pulls/1067","_links":{"self":{"href":"https://api.github.com/repos/slick/slick/pulls/comments/24253872"},"html":{"href":"https://github.com/slick/slick/pull/1067#discussion_r24253872"},"pull_request":{"href":"https://api.github.com/repos/slick/slick/pulls/1067"}}},"pull_request":{"url":"https://api.github.com/repos/slick/slick/pulls/1067","id":28808044,"html_url":"https://github.com/slick/slick/pull/1067","diff_url":"https://github.com/slick/slick/pull/1067.diff","patch_url":"https://github.com/slick/slick/pull/1067.patch","issue_url":"https://api.github.com/repos/slick/slick/issues/1067","number":1067,"state":"open","locked":false,"title":"Update LiftedEmbedding.scala","user":{"login":"mobiworx","id":7679780,"avatar_url":"https://avatars.githubusercontent.com/u/7679780?v=3","gravatar_id":"","url":"https://api.github.com/users/mobiworx","html_url":"https://github.com/mobiworx","followers_url":"https://api.github.com/users/mobiworx/followers","following_url":"https://api.github.com/users/mobiworx/following{/other_user}","gists_url":"https://api.github.com/users/mobiworx/gists{/gist_id}","starred_url":"https://api.github.com/users/mobiworx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobiworx/subscriptions","organizations_url":"https://api.github.com/users/mobiworx/orgs","repos_url":"https://api.github.com/users/mobiworx/repos","events_url":"https://api.github.com/users/mobiworx/events{/privacy}","received_events_url":"https://api.github.com/users/mobiworx/received_events","type":"User","site_admin":false},"body":"documenting \"dynamic filter\"","created_at":"2015-02-06T13:25:17Z","updated_at":"2015-02-06T16:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c269f9b5efdd9de55b89fe9d3f288e20a2df304","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/slick/slick/pulls/1067/commits","review_comments_url":"https://api.github.com/repos/slick/slick/pulls/1067/comments","review_comment_url":"https://api.github.com/repos/slick/slick/pulls/comments/{number}","comments_url":"https://api.github.com/repos/slick/slick/issues/1067/comments","statuses_url":"https://api.github.com/repos/slick/slick/statuses/a284e5f353a1142a1532c856bdc4fa77ec788664","head":{"label":"mobiworx:patch-1","ref":"patch-1","sha":"a284e5f353a1142a1532c856bdc4fa77ec788664","user":{"login":"mobiworx","id":7679780,"avatar_url":"https://avatars.githubusercontent.com/u/7679780?v=3","gravatar_id":"","url":"https://api.github.com/users/mobiworx","html_url":"https://github.com/mobiworx","followers_url":"https://api.github.com/users/mobiworx/followers","following_url":"https://api.github.com/users/mobiworx/following{/other_user}","gists_url":"https://api.github.com/users/mobiworx/gists{/gist_id}","starred_url":"https://api.github.com/users/mobiworx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobiworx/subscriptions","organizations_url":"https://api.github.com/users/mobiworx/orgs","repos_url":"https://api.github.com/users/mobiworx/repos","events_url":"https://api.github.com/users/mobiworx/events{/privacy}","received_events_url":"https://api.github.com/users/mobiworx/received_events","type":"User","site_admin":false},"repo":{"id":22063912,"name":"slick","full_name":"mobiworx/slick","owner":{"login":"mobiworx","id":7679780,"avatar_url":"https://avatars.githubusercontent.com/u/7679780?v=3","gravatar_id":"","url":"https://api.github.com/users/mobiworx","html_url":"https://github.com/mobiworx","followers_url":"https://api.github.com/users/mobiworx/followers","following_url":"https://api.github.com/users/mobiworx/following{/other_user}","gists_url":"https://api.github.com/users/mobiworx/gists{/gist_id}","starred_url":"https://api.github.com/users/mobiworx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobiworx/subscriptions","organizations_url":"https://api.github.com/users/mobiworx/orgs","repos_url":"https://api.github.com/users/mobiworx/repos","events_url":"https://api.github.com/users/mobiworx/events{/privacy}","received_events_url":"https://api.github.com/users/mobiworx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mobiworx/slick","description":"Scala Language Integrated Connection Kit","fork":true,"url":"https://api.github.com/repos/mobiworx/slick","forks_url":"https://api.github.com/repos/mobiworx/slick/forks","keys_url":"https://api.github.com/repos/mobiworx/slick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mobiworx/slick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mobiworx/slick/teams","hooks_url":"https://api.github.com/repos/mobiworx/slick/hooks","issue_events_url":"https://api.github.com/repos/mobiworx/slick/issues/events{/number}","events_url":"https://api.github.com/repos/mobiworx/slick/events","assignees_url":"https://api.github.com/repos/mobiworx/slick/assignees{/user}","branches_url":"https://api.github.com/repos/mobiworx/slick/branches{/branch}","tags_url":"https://api.github.com/repos/mobiworx/slick/tags","blobs_url":"https://api.github.com/repos/mobiworx/slick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mobiworx/slick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mobiworx/slick/git/refs{/sha}","trees_url":"https://api.github.com/repos/mobiworx/slick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mobiworx/slick/statuses/{sha}","languages_url":"https://api.github.com/repos/mobiworx/slick/languages","stargazers_url":"https://api.github.com/repos/mobiworx/slick/stargazers","contributors_url":"https://api.github.com/repos/mobiworx/slick/contributors","subscribers_url":"https://api.github.com/repos/mobiworx/slick/subscribers","subscription_url":"https://api.github.com/repos/mobiworx/slick/subscription","commits_url":"https://api.github.com/repos/mobiworx/slick/commits{/sha}","git_commits_url":"https://api.github.com/repos/mobiworx/slick/git/commits{/sha}","comments_url":"https://api.github.com/repos/mobiworx/slick/comments{/number}","issue_comment_url":"https://api.github.com/repos/mobiworx/slick/issues/comments/{number}","contents_url":"https://api.github.com/repos/mobiworx/slick/contents/{+path}","compare_url":"https://api.github.com/repos/mobiworx/slick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mobiworx/slick/merges","archive_url":"https://api.github.com/repos/mobiworx/slick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mobiworx/slick/downloads","issues_url":"https://api.github.com/repos/mobiworx/slick/issues{/number}","pulls_url":"https://api.github.com/repos/mobiworx/slick/pulls{/number}","milestones_url":"https://api.github.com/repos/mobiworx/slick/milestones{/number}","notifications_url":"https://api.github.com/repos/mobiworx/slick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mobiworx/slick/labels{/name}","releases_url":"https://api.github.com/repos/mobiworx/slick/releases{/id}","created_at":"2014-07-21T12:45:33Z","updated_at":"2014-07-20T07:30:57Z","pushed_at":"2015-02-06T13:42:07Z","git_url":"git://github.com/mobiworx/slick.git","ssh_url":"git@github.com:mobiworx/slick.git","clone_url":"https://github.com/mobiworx/slick.git","svn_url":"https://github.com/mobiworx/slick","homepage":"http://slick.typesafe.com","size":7754,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"slick:master","ref":"master","sha":"ac5a097e4610aa7814fa28f82e8e4d91a31f613f","user":{"login":"slick","id":1752624,"avatar_url":"https://avatars.githubusercontent.com/u/1752624?v=3","gravatar_id":"","url":"https://api.github.com/users/slick","html_url":"https://github.com/slick","followers_url":"https://api.github.com/users/slick/followers","following_url":"https://api.github.com/users/slick/following{/other_user}","gists_url":"https://api.github.com/users/slick/gists{/gist_id}","starred_url":"https://api.github.com/users/slick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slick/subscriptions","organizations_url":"https://api.github.com/users/slick/orgs","repos_url":"https://api.github.com/users/slick/repos","events_url":"https://api.github.com/users/slick/events{/privacy}","received_events_url":"https://api.github.com/users/slick/received_events","type":"Organization","site_admin":false},"repo":{"id":133684,"name":"slick","full_name":"slick/slick","owner":{"login":"slick","id":1752624,"avatar_url":"https://avatars.githubusercontent.com/u/1752624?v=3","gravatar_id":"","url":"https://api.github.com/users/slick","html_url":"https://github.com/slick","followers_url":"https://api.github.com/users/slick/followers","following_url":"https://api.github.com/users/slick/following{/other_user}","gists_url":"https://api.github.com/users/slick/gists{/gist_id}","starred_url":"https://api.github.com/users/slick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slick/subscriptions","organizations_url":"https://api.github.com/users/slick/orgs","repos_url":"https://api.github.com/users/slick/repos","events_url":"https://api.github.com/users/slick/events{/privacy}","received_events_url":"https://api.github.com/users/slick/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slick/slick","description":"Scala Language Integrated Connection Kit","fork":false,"url":"https://api.github.com/repos/slick/slick","forks_url":"https://api.github.com/repos/slick/slick/forks","keys_url":"https://api.github.com/repos/slick/slick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slick/slick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slick/slick/teams","hooks_url":"https://api.github.com/repos/slick/slick/hooks","issue_events_url":"https://api.github.com/repos/slick/slick/issues/events{/number}","events_url":"https://api.github.com/repos/slick/slick/events","assignees_url":"https://api.github.com/repos/slick/slick/assignees{/user}","branches_url":"https://api.github.com/repos/slick/slick/branches{/branch}","tags_url":"https://api.github.com/repos/slick/slick/tags","blobs_url":"https://api.github.com/repos/slick/slick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slick/slick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slick/slick/git/refs{/sha}","trees_url":"https://api.github.com/repos/slick/slick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slick/slick/statuses/{sha}","languages_url":"https://api.github.com/repos/slick/slick/languages","stargazers_url":"https://api.github.com/repos/slick/slick/stargazers","contributors_url":"https://api.github.com/repos/slick/slick/contributors","subscribers_url":"https://api.github.com/repos/slick/slick/subscribers","subscription_url":"https://api.github.com/repos/slick/slick/subscription","commits_url":"https://api.github.com/repos/slick/slick/commits{/sha}","git_commits_url":"https://api.github.com/repos/slick/slick/git/commits{/sha}","comments_url":"https://api.github.com/repos/slick/slick/comments{/number}","issue_comment_url":"https://api.github.com/repos/slick/slick/issues/comments/{number}","contents_url":"https://api.github.com/repos/slick/slick/contents/{+path}","compare_url":"https://api.github.com/repos/slick/slick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slick/slick/merges","archive_url":"https://api.github.com/repos/slick/slick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slick/slick/downloads","issues_url":"https://api.github.com/repos/slick/slick/issues{/number}","pulls_url":"https://api.github.com/repos/slick/slick/pulls{/number}","milestones_url":"https://api.github.com/repos/slick/slick/milestones{/number}","notifications_url":"https://api.github.com/repos/slick/slick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slick/slick/labels{/name}","releases_url":"https://api.github.com/repos/slick/slick/releases{/id}","created_at":"2009-02-20T22:51:53Z","updated_at":"2015-02-05T16:44:57Z","pushed_at":"2015-02-05T17:06:38Z","git_url":"git://github.com/slick/slick.git","ssh_url":"git@github.com:slick/slick.git","clone_url":"https://github.com/slick/slick.git","svn_url":"https://github.com/slick/slick","homepage":"http://slick.typesafe.com","size":15394,"stargazers_count":1076,"watchers_count":1076,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":218,"mirror_url":null,"open_issues_count":257,"forks":218,"open_issues":257,"watchers":1076,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slick/slick/pulls/1067"},"html":{"href":"https://github.com/slick/slick/pull/1067"},"issue":{"href":"https://api.github.com/repos/slick/slick/issues/1067"},"comments":{"href":"https://api.github.com/repos/slick/slick/issues/1067/comments"},"review_comments":{"href":"https://api.github.com/repos/slick/slick/pulls/1067/comments"},"review_comment":{"href":"https://api.github.com/repos/slick/slick/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/slick/slick/pulls/1067/commits"},"statuses":{"href":"https://api.github.com/repos/slick/slick/statuses/a284e5f353a1142a1532c856bdc4fa77ec788664"}}}}