{"action":"created","issue":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/964","repository_url":"https://api.github.com/repos/brianc/node-postgres","labels_url":"https://api.github.com/repos/brianc/node-postgres/issues/964/labels{/name}","comments_url":"https://api.github.com/repos/brianc/node-postgres/issues/964/comments","events_url":"https://api.github.com/repos/brianc/node-postgres/issues/964/events","html_url":"https://github.com/brianc/node-postgres/issues/964","id":139900870,"number":964,"title":"Expand parameterized query","user":{"login":"ktrzeciaknubisa","id":5946844,"avatar_url":"https://avatars.githubusercontent.com/u/5946844?v=3","gravatar_id":"","url":"https://api.github.com/users/ktrzeciaknubisa","html_url":"https://github.com/ktrzeciaknubisa","followers_url":"https://api.github.com/users/ktrzeciaknubisa/followers","following_url":"https://api.github.com/users/ktrzeciaknubisa/following{/other_user}","gists_url":"https://api.github.com/users/ktrzeciaknubisa/gists{/gist_id}","starred_url":"https://api.github.com/users/ktrzeciaknubisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktrzeciaknubisa/subscriptions","organizations_url":"https://api.github.com/users/ktrzeciaknubisa/orgs","repos_url":"https://api.github.com/users/ktrzeciaknubisa/repos","events_url":"https://api.github.com/users/ktrzeciaknubisa/events{/privacy}","received_events_url":"https://api.github.com/users/ktrzeciaknubisa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-10T14:20:55Z","updated_at":"2016-03-22T20:06:43Z","closed_at":null,"body":"Say I have this query:\r\n\r\n```js\r\n var query = client.query({\r\n      text: 'SELECT name FROM users WHERE email = $1',\r\n      values: ['brianc@example.com']\r\n    });\r\n```\r\n\r\nIs there any way to have it \"expanded\" and get the following sql query **string**?\r\n\r\n```js\r\nvar sql = pg.expand(query); // a method I'm asking for\r\n// sql = 'SELECT name FROM users WHERE email = 'brianc@example.com';\r\n```\r\nI know I can do it myself (by replacing $x items with those from a values array - taking care whether I should quote value string or not etc.), but I'm asking whether `node-postgres` already offers such solution?"},"comment":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/comments/199996845","html_url":"https://github.com/brianc/node-postgres/issues/964#issuecomment-199996845","issue_url":"https://api.github.com/repos/brianc/node-postgres/issues/964","id":199996845,"user":{"login":"rpedela","id":1952582,"avatar_url":"https://avatars.githubusercontent.com/u/1952582?v=3","gravatar_id":"","url":"https://api.github.com/users/rpedela","html_url":"https://github.com/rpedela","followers_url":"https://api.github.com/users/rpedela/followers","following_url":"https://api.github.com/users/rpedela/following{/other_user}","gists_url":"https://api.github.com/users/rpedela/gists{/gist_id}","starred_url":"https://api.github.com/users/rpedela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpedela/subscriptions","organizations_url":"https://api.github.com/users/rpedela/orgs","repos_url":"https://api.github.com/users/rpedela/repos","events_url":"https://api.github.com/users/rpedela/events{/privacy}","received_events_url":"https://api.github.com/users/rpedela/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T20:06:43Z","updated_at":"2016-03-22T20:06:43Z","body":"I wrote [pg-format](https://github.com/datalanche/node-pg-format) which you could probably use for this.\r\n\r\n```js\r\nvar format = require('pg-format');\r\nconsole.log(format('SELECT name FROM users WHERE email = %L', 'brianc@example.com'));\r\n// SELECT name FROM users WHERE email = 'brianc@example.com'\r\n```"}}