{"action":"created","comment":{"url":"https://api.github.com/repos/slick/slick/pulls/comments/72387680","id":72387680,"diff_hunk":"@@ -62,6 +62,8 @@ trait JdbcProfile extends SqlProfile with JdbcActionComponent\n       new JdbcActionExtensionMethods[E, R, S](a)\n \n     implicit def actionBasedSQLInterpolation(s: StringContext): ActionBasedSQLInterpolation = new ActionBasedSQLInterpolation(s)\n+\n+    def unsafeSQL(sql: String): SQLActionBuilder = new SQLActionBuilder(Seq(sql + \" \"), SetParameter.SetUnit)","path":"slick/src/main/scala/slick/jdbc/JdbcProfile.scala","position":5,"original_position":5,"commit_id":"94f307f3d044cb840ac258fe2800a09d86ac7a4e","original_commit_id":"94f307f3d044cb840ac258fe2800a09d86ac7a4e","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":"why do we put a space at the end there?","created_at":"2016-07-27T06:42:30Z","updated_at":"2016-07-27T06:42:30Z","html_url":"https://github.com/slick/slick/pull/1548#discussion_r72387680","pull_request_url":"https://api.github.com/repos/slick/slick/pulls/1548","_links":{"self":{"href":"https://api.github.com/repos/slick/slick/pulls/comments/72387680"},"html":{"href":"https://github.com/slick/slick/pull/1548#discussion_r72387680"},"pull_request":{"href":"https://api.github.com/repos/slick/slick/pulls/1548"}}},"pull_request":{"url":"https://api.github.com/repos/slick/slick/pulls/1548","id":76063826,"html_url":"https://github.com/slick/slick/pull/1548","diff_url":"https://github.com/slick/slick/pull/1548.diff","patch_url":"https://github.com/slick/slick/pull/1548.patch","issue_url":"https://api.github.com/repos/slick/slick/issues/1548","number":1548,"state":"open","locked":false,"title":"Improvements to Plain-Sql API","user":{"login":"radsaggi","id":3859208,"avatar_url":"https://avatars.githubusercontent.com/u/3859208?v=3","gravatar_id":"","url":"https://api.github.com/users/radsaggi","html_url":"https://github.com/radsaggi","followers_url":"https://api.github.com/users/radsaggi/followers","following_url":"https://api.github.com/users/radsaggi/following{/other_user}","gists_url":"https://api.github.com/users/radsaggi/gists{/gist_id}","starred_url":"https://api.github.com/users/radsaggi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radsaggi/subscriptions","organizations_url":"https://api.github.com/users/radsaggi/orgs","repos_url":"https://api.github.com/users/radsaggi/repos","events_url":"https://api.github.com/users/radsaggi/events{/privacy}","received_events_url":"https://api.github.com/users/radsaggi/received_events","type":"User","site_admin":false},"body":"**Composable queries #1161**\r\n\r\nWe need to devise a new API as an extension of existing \"PlainSQL Interpolation API\"\r\nThe proposal is to add a `++` operator to the SQLActionBuilder so that queries can be composed like\r\n```scala\r\nval q = sql\" ... \" ++ sql\" ... \"\r\n```\r\n\r\nThe `++` operator also supports optional queries. For eg\r\n```scala\r\nval id: Option[String] = ...\r\nval optQ = id.map { i => sql\" WHERE ID = $i\" }\r\nval q = sql\"SELECT * FROM table\" ++ optQ\r\n```\r\n\r\nThe final result can be evaluated using the `as`, `asUpdate` or `typecheck` method\r\n```scala\r\nval ac1 = q.as[T]     //same as sql\r\nval ac2 = q.asUpdate  //same as sqlu\r\nval ac3 = q.typecheck //same as tsql\r\n```\r\n\r\nExisting interpolators resolve to one of the above functions in the background.\r\n\r\n**Open Questions**\r\n1. Should we delay the macro evaluation until `as`, `asUpdate` or `typecheck` is called?\r\n2. How can we better support multiple optional constructs? like multiple optional checks in `WHERE` clause. Do we want to support this?\r\n3. Other suggestions/requirements for this API improvement?\r\n\r\n**Other Improvements**\r\n1. Improvements in `MacroTreeBuilder.scala` and `StaticQuery.scala`: elaborate use of quasiquotes and macro bundles can be brought in.\r\n2. Let the macro evaluate Strings instead of demanding String literals when trying to construct a query statement\r\n\r\nThis is still a WIP(and hence the PlainSQLTests are only indicative and not complete). This PR has been opened to encourage discussion.\r\n\r\nEdit: `typecheck` is not being implemented in this PR. Check [this comment](https://github.com/slick/slick/pull/1548#issuecomment-232558031) for details.","created_at":"2016-07-02T12:18:32Z","updated_at":"2016-07-27T06:42:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b87a71bea5b0508d5c1480e62fb88505bc6907c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/slick/slick/pulls/1548/commits","review_comments_url":"https://api.github.com/repos/slick/slick/pulls/1548/comments","review_comment_url":"https://api.github.com/repos/slick/slick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slick/slick/issues/1548/comments","statuses_url":"https://api.github.com/repos/slick/slick/statuses/94f307f3d044cb840ac258fe2800a09d86ac7a4e","head":{"label":"radsaggi:tmp/composable-queries","ref":"tmp/composable-queries","sha":"94f307f3d044cb840ac258fe2800a09d86ac7a4e","user":{"login":"radsaggi","id":3859208,"avatar_url":"https://avatars.githubusercontent.com/u/3859208?v=3","gravatar_id":"","url":"https://api.github.com/users/radsaggi","html_url":"https://github.com/radsaggi","followers_url":"https://api.github.com/users/radsaggi/followers","following_url":"https://api.github.com/users/radsaggi/following{/other_user}","gists_url":"https://api.github.com/users/radsaggi/gists{/gist_id}","starred_url":"https://api.github.com/users/radsaggi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radsaggi/subscriptions","organizations_url":"https://api.github.com/users/radsaggi/orgs","repos_url":"https://api.github.com/users/radsaggi/repos","events_url":"https://api.github.com/users/radsaggi/events{/privacy}","received_events_url":"https://api.github.com/users/radsaggi/received_events","type":"User","site_admin":false},"repo":{"id":17348476,"name":"slick","full_name":"radsaggi/slick","owner":{"login":"radsaggi","id":3859208,"avatar_url":"https://avatars.githubusercontent.com/u/3859208?v=3","gravatar_id":"","url":"https://api.github.com/users/radsaggi","html_url":"https://github.com/radsaggi","followers_url":"https://api.github.com/users/radsaggi/followers","following_url":"https://api.github.com/users/radsaggi/following{/other_user}","gists_url":"https://api.github.com/users/radsaggi/gists{/gist_id}","starred_url":"https://api.github.com/users/radsaggi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radsaggi/subscriptions","organizations_url":"https://api.github.com/users/radsaggi/orgs","repos_url":"https://api.github.com/users/radsaggi/repos","events_url":"https://api.github.com/users/radsaggi/events{/privacy}","received_events_url":"https://api.github.com/users/radsaggi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radsaggi/slick","description":"Scala Language Integrated Connection Kit","fork":true,"url":"https://api.github.com/repos/radsaggi/slick","forks_url":"https://api.github.com/repos/radsaggi/slick/forks","keys_url":"https://api.github.com/repos/radsaggi/slick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radsaggi/slick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radsaggi/slick/teams","hooks_url":"https://api.github.com/repos/radsaggi/slick/hooks","issue_events_url":"https://api.github.com/repos/radsaggi/slick/issues/events{/number}","events_url":"https://api.github.com/repos/radsaggi/slick/events","assignees_url":"https://api.github.com/repos/radsaggi/slick/assignees{/user}","branches_url":"https://api.github.com/repos/radsaggi/slick/branches{/branch}","tags_url":"https://api.github.com/repos/radsaggi/slick/tags","blobs_url":"https://api.github.com/repos/radsaggi/slick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radsaggi/slick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radsaggi/slick/git/refs{/sha}","trees_url":"https://api.github.com/repos/radsaggi/slick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radsaggi/slick/statuses/{sha}","languages_url":"https://api.github.com/repos/radsaggi/slick/languages","stargazers_url":"https://api.github.com/repos/radsaggi/slick/stargazers","contributors_url":"https://api.github.com/repos/radsaggi/slick/contributors","subscribers_url":"https://api.github.com/repos/radsaggi/slick/subscribers","subscription_url":"https://api.github.com/repos/radsaggi/slick/subscription","commits_url":"https://api.github.com/repos/radsaggi/slick/commits{/sha}","git_commits_url":"https://api.github.com/repos/radsaggi/slick/git/commits{/sha}","comments_url":"https://api.github.com/repos/radsaggi/slick/comments{/number}","issue_comment_url":"https://api.github.com/repos/radsaggi/slick/issues/comments{/number}","contents_url":"https://api.github.com/repos/radsaggi/slick/contents/{+path}","compare_url":"https://api.github.com/repos/radsaggi/slick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radsaggi/slick/merges","archive_url":"https://api.github.com/repos/radsaggi/slick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radsaggi/slick/downloads","issues_url":"https://api.github.com/repos/radsaggi/slick/issues{/number}","pulls_url":"https://api.github.com/repos/radsaggi/slick/pulls{/number}","milestones_url":"https://api.github.com/repos/radsaggi/slick/milestones{/number}","notifications_url":"https://api.github.com/repos/radsaggi/slick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radsaggi/slick/labels{/name}","releases_url":"https://api.github.com/repos/radsaggi/slick/releases{/id}","deployments_url":"https://api.github.com/repos/radsaggi/slick/deployments","created_at":"2014-03-02T22:24:43Z","updated_at":"2016-05-06T18:05:46Z","pushed_at":"2016-07-27T06:32:45Z","git_url":"git://github.com/radsaggi/slick.git","ssh_url":"git@github.com:radsaggi/slick.git","clone_url":"https://github.com/radsaggi/slick.git","svn_url":"https://github.com/radsaggi/slick","homepage":"http://slick.typesafe.com","size":9644,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"a0eb1ee1a06cac2b34680a3be9abdc478ce2b953","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}","deployments_url":"https://api.github.com/repos/slick/slick/deployments","created_at":"2009-02-20T22:51:53Z","updated_at":"2016-07-26T10:48:20Z","pushed_at":"2016-07-27T06:32:47Z","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.lightbend.com","size":13466,"stargazers_count":1597,"watchers_count":1597,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":374,"mirror_url":null,"open_issues_count":384,"forks":374,"open_issues":384,"watchers":1597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slick/slick/pulls/1548"},"html":{"href":"https://github.com/slick/slick/pull/1548"},"issue":{"href":"https://api.github.com/repos/slick/slick/issues/1548"},"comments":{"href":"https://api.github.com/repos/slick/slick/issues/1548/comments"},"review_comments":{"href":"https://api.github.com/repos/slick/slick/pulls/1548/comments"},"review_comment":{"href":"https://api.github.com/repos/slick/slick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slick/slick/pulls/1548/commits"},"statuses":{"href":"https://api.github.com/repos/slick/slick/statuses/94f307f3d044cb840ac258fe2800a09d86ac7a4e"}}}}
{"actor":{"display_login":"cvogt"}}