{"action":"created","comment":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/46439479","id":46439479,"diff_hunk":"@@ -61,14 +62,18 @@ object MongoDbConfig {\n     casecodec1(MongoDbConfig.apply, MongoDbConfig.unapply)(\"connectionUri\")\n }\n \n-final case class ViewConfig(query: sql.Expr) extends MountConfig {\n-  def validate(path: EnginePath) =\n-    if (path.relative) -\\/(InvalidConfig(\"Not an absolute path: \" + path))\n-    else if (path.pureDir) -\\/(InvalidConfig(\"Not a file path: \" + path))\n-    else \\/-(())\n+final case class ViewConfig(query: sql.Expr, variables: Variables) extends MountConfig {\n+  def validate(path: EnginePath) = for {\n+    _ <- if (path.relative) -\\/(InvalidConfig(\"Not an absolute path: \" + path))\n+          else if (path.pureDir) -\\/(InvalidConfig(\"Not a file path: \" + path))\n+          else \\/-(())\n+    _ <- Variables.substVars(query, variables).leftMap(e => EnvCompError(CSemanticError(e)))\n+  } yield ()\n }\n object ViewConfig {\n-  private val UriPattern = \"([a-z][a-z0-9+-.]*):///\\\\?q=(.+)\".r\n+  private val VarPatternStr = \"var\\\\.([^=]+)=([^&]+)\"","path":"core/src/main/scala/quasar/config/config.scala","position":37,"original_position":37,"commit_id":"02f38a75a4253e7f4ea40437fee2c66214c43a64","original_commit_id":"02f38a75a4253e7f4ea40437fee2c66214c43a64","user":{"login":"wemrysi","id":32185,"avatar_url":"https://avatars.githubusercontent.com/u/32185?v=3","gravatar_id":"","url":"https://api.github.com/users/wemrysi","html_url":"https://github.com/wemrysi","followers_url":"https://api.github.com/users/wemrysi/followers","following_url":"https://api.github.com/users/wemrysi/following{/other_user}","gists_url":"https://api.github.com/users/wemrysi/gists{/gist_id}","starred_url":"https://api.github.com/users/wemrysi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wemrysi/subscriptions","organizations_url":"https://api.github.com/users/wemrysi/orgs","repos_url":"https://api.github.com/users/wemrysi/repos","events_url":"https://api.github.com/users/wemrysi/events{/privacy}","received_events_url":"https://api.github.com/users/wemrysi/received_events","type":"User","site_admin":false},"body":"I tried parsing some view uris with it at the repl, seemed to work ok on the ones I tried. You can also get a nice `Map` of the query parameters.","created_at":"2015-12-02T16:44:55Z","updated_at":"2015-12-02T16:44:55Z","html_url":"https://github.com/quasar-analytics/quasar/pull/1017#discussion_r46439479","pull_request_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017","_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/46439479"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/1017#discussion_r46439479"},"pull_request":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017"}}},"pull_request":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017","id":52326429,"html_url":"https://github.com/quasar-analytics/quasar/pull/1017","diff_url":"https://github.com/quasar-analytics/quasar/pull/1017.diff","patch_url":"https://github.com/quasar-analytics/quasar/pull/1017.patch","issue_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1017","number":1017,"state":"open","locked":false,"title":"handle variable bindings in views","user":{"login":"mossprescott","id":6147371,"avatar_url":"https://avatars.githubusercontent.com/u/6147371?v=3","gravatar_id":"","url":"https://api.github.com/users/mossprescott","html_url":"https://github.com/mossprescott","followers_url":"https://api.github.com/users/mossprescott/followers","following_url":"https://api.github.com/users/mossprescott/following{/other_user}","gists_url":"https://api.github.com/users/mossprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mossprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossprescott/subscriptions","organizations_url":"https://api.github.com/users/mossprescott/orgs","repos_url":"https://api.github.com/users/mossprescott/repos","events_url":"https://api.github.com/users/mossprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mossprescott/received_events","type":"User","site_admin":false},"body":"SD-1143 #done\r\n\r\nAccept variable bindings in the connectionUri for a view mount. These are parsed out to a Variables map in ViewConfig (so they can be re-serialied later), and substituted into the view query when it is mounted. Unbound variables lead to errors 1) when a view mount is added through the API and 2) whenever a view query is evaluated through Backend's methods.\r\n\r\nA few new bits and pieces:\r\n- Yet another error wrapper to embed CompilationError in EnvironmentError.\r\n- A convenience `substVars()` which doesn't need type annotations, since it's now being used in a third place.\r\n- Replace `rewriteRelations()` with `rewriteRelationsM()`.","created_at":"2015-12-01T22:33:02Z","updated_at":"2015-12-02T16:44:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12fd733c7e407decc36e632571aa3aa9d1fa6b34","assignee":{"login":"wemrysi","id":32185,"avatar_url":"https://avatars.githubusercontent.com/u/32185?v=3","gravatar_id":"","url":"https://api.github.com/users/wemrysi","html_url":"https://github.com/wemrysi","followers_url":"https://api.github.com/users/wemrysi/followers","following_url":"https://api.github.com/users/wemrysi/following{/other_user}","gists_url":"https://api.github.com/users/wemrysi/gists{/gist_id}","starred_url":"https://api.github.com/users/wemrysi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wemrysi/subscriptions","organizations_url":"https://api.github.com/users/wemrysi/orgs","repos_url":"https://api.github.com/users/wemrysi/repos","events_url":"https://api.github.com/users/wemrysi/events{/privacy}","received_events_url":"https://api.github.com/users/wemrysi/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017/commits","review_comments_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017/comments","review_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1017/comments","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/02f38a75a4253e7f4ea40437fee2c66214c43a64","head":{"label":"mossprescott:wip/SD-1143","ref":"wip/SD-1143","sha":"02f38a75a4253e7f4ea40437fee2c66214c43a64","user":{"login":"mossprescott","id":6147371,"avatar_url":"https://avatars.githubusercontent.com/u/6147371?v=3","gravatar_id":"","url":"https://api.github.com/users/mossprescott","html_url":"https://github.com/mossprescott","followers_url":"https://api.github.com/users/mossprescott/followers","following_url":"https://api.github.com/users/mossprescott/following{/other_user}","gists_url":"https://api.github.com/users/mossprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mossprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossprescott/subscriptions","organizations_url":"https://api.github.com/users/mossprescott/orgs","repos_url":"https://api.github.com/users/mossprescott/repos","events_url":"https://api.github.com/users/mossprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mossprescott/received_events","type":"User","site_admin":false},"repo":{"id":21178367,"name":"quasar","full_name":"mossprescott/quasar","owner":{"login":"mossprescott","id":6147371,"avatar_url":"https://avatars.githubusercontent.com/u/6147371?v=3","gravatar_id":"","url":"https://api.github.com/users/mossprescott","html_url":"https://github.com/mossprescott","followers_url":"https://api.github.com/users/mossprescott/followers","following_url":"https://api.github.com/users/mossprescott/following{/other_user}","gists_url":"https://api.github.com/users/mossprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mossprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossprescott/subscriptions","organizations_url":"https://api.github.com/users/mossprescott/orgs","repos_url":"https://api.github.com/users/mossprescott/repos","events_url":"https://api.github.com/users/mossprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mossprescott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mossprescott/quasar","description":"The engine for SlamData","fork":true,"url":"https://api.github.com/repos/mossprescott/quasar","forks_url":"https://api.github.com/repos/mossprescott/quasar/forks","keys_url":"https://api.github.com/repos/mossprescott/quasar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mossprescott/quasar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mossprescott/quasar/teams","hooks_url":"https://api.github.com/repos/mossprescott/quasar/hooks","issue_events_url":"https://api.github.com/repos/mossprescott/quasar/issues/events{/number}","events_url":"https://api.github.com/repos/mossprescott/quasar/events","assignees_url":"https://api.github.com/repos/mossprescott/quasar/assignees{/user}","branches_url":"https://api.github.com/repos/mossprescott/quasar/branches{/branch}","tags_url":"https://api.github.com/repos/mossprescott/quasar/tags","blobs_url":"https://api.github.com/repos/mossprescott/quasar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mossprescott/quasar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mossprescott/quasar/git/refs{/sha}","trees_url":"https://api.github.com/repos/mossprescott/quasar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mossprescott/quasar/statuses/{sha}","languages_url":"https://api.github.com/repos/mossprescott/quasar/languages","stargazers_url":"https://api.github.com/repos/mossprescott/quasar/stargazers","contributors_url":"https://api.github.com/repos/mossprescott/quasar/contributors","subscribers_url":"https://api.github.com/repos/mossprescott/quasar/subscribers","subscription_url":"https://api.github.com/repos/mossprescott/quasar/subscription","commits_url":"https://api.github.com/repos/mossprescott/quasar/commits{/sha}","git_commits_url":"https://api.github.com/repos/mossprescott/quasar/git/commits{/sha}","comments_url":"https://api.github.com/repos/mossprescott/quasar/comments{/number}","issue_comment_url":"https://api.github.com/repos/mossprescott/quasar/issues/comments{/number}","contents_url":"https://api.github.com/repos/mossprescott/quasar/contents/{+path}","compare_url":"https://api.github.com/repos/mossprescott/quasar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mossprescott/quasar/merges","archive_url":"https://api.github.com/repos/mossprescott/quasar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mossprescott/quasar/downloads","issues_url":"https://api.github.com/repos/mossprescott/quasar/issues{/number}","pulls_url":"https://api.github.com/repos/mossprescott/quasar/pulls{/number}","milestones_url":"https://api.github.com/repos/mossprescott/quasar/milestones{/number}","notifications_url":"https://api.github.com/repos/mossprescott/quasar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mossprescott/quasar/labels{/name}","releases_url":"https://api.github.com/repos/mossprescott/quasar/releases{/id}","created_at":"2014-06-24T19:43:22Z","updated_at":"2015-09-14T21:35:18Z","pushed_at":"2015-12-01T22:14:05Z","git_url":"git://github.com/mossprescott/quasar.git","ssh_url":"git@github.com:mossprescott/quasar.git","clone_url":"https://github.com/mossprescott/quasar.git","svn_url":"https://github.com/mossprescott/quasar","homepage":null,"size":7947,"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":"CHECK-UPSTREAM-REPO"}},"base":{"label":"quasar-analytics:master","ref":"master","sha":"329e4f7368002ed852910f7fbaffe61e33a347b7","user":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"repo":{"id":16515058,"name":"quasar","full_name":"quasar-analytics/quasar","owner":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quasar-analytics/quasar","description":"A NoSQL analytics engine that embraces post-relational analytics and pushes computation to the data.","fork":false,"url":"https://api.github.com/repos/quasar-analytics/quasar","forks_url":"https://api.github.com/repos/quasar-analytics/quasar/forks","keys_url":"https://api.github.com/repos/quasar-analytics/quasar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quasar-analytics/quasar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quasar-analytics/quasar/teams","hooks_url":"https://api.github.com/repos/quasar-analytics/quasar/hooks","issue_events_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/events{/number}","events_url":"https://api.github.com/repos/quasar-analytics/quasar/events","assignees_url":"https://api.github.com/repos/quasar-analytics/quasar/assignees{/user}","branches_url":"https://api.github.com/repos/quasar-analytics/quasar/branches{/branch}","tags_url":"https://api.github.com/repos/quasar-analytics/quasar/tags","blobs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quasar-analytics/quasar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/refs{/sha}","trees_url":"https://api.github.com/repos/quasar-analytics/quasar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/{sha}","languages_url":"https://api.github.com/repos/quasar-analytics/quasar/languages","stargazers_url":"https://api.github.com/repos/quasar-analytics/quasar/stargazers","contributors_url":"https://api.github.com/repos/quasar-analytics/quasar/contributors","subscribers_url":"https://api.github.com/repos/quasar-analytics/quasar/subscribers","subscription_url":"https://api.github.com/repos/quasar-analytics/quasar/subscription","commits_url":"https://api.github.com/repos/quasar-analytics/quasar/commits{/sha}","git_commits_url":"https://api.github.com/repos/quasar-analytics/quasar/git/commits{/sha}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/comments{/number}","issue_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/comments{/number}","contents_url":"https://api.github.com/repos/quasar-analytics/quasar/contents/{+path}","compare_url":"https://api.github.com/repos/quasar-analytics/quasar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quasar-analytics/quasar/merges","archive_url":"https://api.github.com/repos/quasar-analytics/quasar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quasar-analytics/quasar/downloads","issues_url":"https://api.github.com/repos/quasar-analytics/quasar/issues{/number}","pulls_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls{/number}","milestones_url":"https://api.github.com/repos/quasar-analytics/quasar/milestones{/number}","notifications_url":"https://api.github.com/repos/quasar-analytics/quasar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quasar-analytics/quasar/labels{/name}","releases_url":"https://api.github.com/repos/quasar-analytics/quasar/releases{/id}","created_at":"2014-02-04T15:01:27Z","updated_at":"2015-11-20T19:02:33Z","pushed_at":"2015-12-02T01:09:43Z","git_url":"git://github.com/quasar-analytics/quasar.git","ssh_url":"git@github.com:quasar-analytics/quasar.git","clone_url":"https://github.com/quasar-analytics/quasar.git","svn_url":"https://github.com/quasar-analytics/quasar","homepage":"","size":8369,"stargazers_count":164,"watchers_count":164,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":160,"forks":38,"open_issues":160,"watchers":164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/1017"},"issue":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/1017"},"comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/1017/comments"},"review_comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017/comments"},"review_comment":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1017/commits"},"statuses":{"href":"https://api.github.com/repos/quasar-analytics/quasar/statuses/02f38a75a4253e7f4ea40437fee2c66214c43a64"}}}}