{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1854","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1854/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1854/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1854/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1854","id":193180212,"number":1854,"title":"bigquery: support SQL parameters","user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars.githubusercontent.com/u/723048?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"labels":[{"id":168217170,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/labels/bigquery","name":"bigquery","color":"eb6420","default":false},{"id":107867207,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false},{"id":97433038,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"callmehiphop","id":1707267,"avatar_url":"https://avatars.githubusercontent.com/u/1707267?v=3","gravatar_id":"","url":"https://api.github.com/users/callmehiphop","html_url":"https://github.com/callmehiphop","followers_url":"https://api.github.com/users/callmehiphop/followers","following_url":"https://api.github.com/users/callmehiphop/following{/other_user}","gists_url":"https://api.github.com/users/callmehiphop/gists{/gist_id}","starred_url":"https://api.github.com/users/callmehiphop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callmehiphop/subscriptions","organizations_url":"https://api.github.com/users/callmehiphop/orgs","repos_url":"https://api.github.com/users/callmehiphop/repos","events_url":"https://api.github.com/users/callmehiphop/events{/privacy}","received_events_url":"https://api.github.com/users/callmehiphop/received_events","type":"User","site_admin":false},"assignees":[{"login":"callmehiphop","id":1707267,"avatar_url":"https://avatars.githubusercontent.com/u/1707267?v=3","gravatar_id":"","url":"https://api.github.com/users/callmehiphop","html_url":"https://github.com/callmehiphop","followers_url":"https://api.github.com/users/callmehiphop/followers","following_url":"https://api.github.com/users/callmehiphop/following{/other_user}","gists_url":"https://api.github.com/users/callmehiphop/gists{/gist_id}","starred_url":"https://api.github.com/users/callmehiphop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callmehiphop/subscriptions","organizations_url":"https://api.github.com/users/callmehiphop/orgs","repos_url":"https://api.github.com/users/callmehiphop/repos","events_url":"https://api.github.com/users/callmehiphop/events{/privacy}","received_events_url":"https://api.github.com/users/callmehiphop/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-12-02T18:04:36Z","updated_at":"2016-12-06T01:21:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/pulls/1854","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1854","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1854.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1854.patch"},"body":"Fixes #1787\r\n\r\n#### To Dos\r\n\r\n- [x] Docs\r\n- Tests\r\n  - System\r\n    - Positional\r\n      - [x] Arrays\r\n      - [x] Booleans\r\n      - [x] Dates\r\n      - [x] Floats\r\n      - [x] Integers\r\n      - [x] Strings\r\n      - [ ] Structs\r\n    - Named\r\n      - [x] Arrays\r\n      - [x] Booleans\r\n      - [x] Dates\r\n      - [x] Floats\r\n      - [x] Integers\r\n      - [x] Strings\r\n      - [ ] Structs\r\n  - [x] Unit\r\n\r\nThis introduces a nice wrapper around SQL parameter queries, allowing positional and named parameters:\r\n\r\n```js\r\nbigquery.query({\r\n  query: 'SELECT * FROM `github` WHERE owner = ?',\r\n  params: ['stephenplusplus']\r\n}, callback);\r\n\r\nbigquery.query({\r\n  query: 'SELECT * FROM `github` WHERE owner = @owner',\r\n  params: {\r\n    owner: 'stephenplusplus'\r\n  }\r\n}, callback);\r\n```\r\n\r\nHelpful resources:\r\n  - https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#request-body\r\n  - https://github.com/GoogleCloudPlatform/google-cloud-python/pull/2776/files\r\n  - https://github.com/GoogleCloudPlatform/google-cloud-ruby/pull/1094/files"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/comments/265032221","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1854#issuecomment-265032221","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-node/issues/1854","id":265032221,"user":{"login":"blowmage","id":730,"avatar_url":"https://avatars.githubusercontent.com/u/730?v=3","gravatar_id":"","url":"https://api.github.com/users/blowmage","html_url":"https://github.com/blowmage","followers_url":"https://api.github.com/users/blowmage/followers","following_url":"https://api.github.com/users/blowmage/following{/other_user}","gists_url":"https://api.github.com/users/blowmage/gists{/gist_id}","starred_url":"https://api.github.com/users/blowmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blowmage/subscriptions","organizations_url":"https://api.github.com/users/blowmage/orgs","repos_url":"https://api.github.com/users/blowmage/repos","events_url":"https://api.github.com/users/blowmage/events{/privacy}","received_events_url":"https://api.github.com/users/blowmage/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T01:21:25Z","updated_at":"2016-12-06T01:21:25Z","body":"Probably worth noting that there are more types that can be supported. Our initial implementation missed DATETIME, TIME, and BYTES. (See https://github.com/GoogleCloudPlatform/google-cloud-ruby/pull/1100)"}}
{"actor":{"display_login":"blowmage"}}