{"action":"created","issue":{"url":"https://api.github.com/repos/felixge/node-mysql/issues/1086","labels_url":"https://api.github.com/repos/felixge/node-mysql/issues/1086/labels{/name}","comments_url":"https://api.github.com/repos/felixge/node-mysql/issues/1086/comments","events_url":"https://api.github.com/repos/felixge/node-mysql/issues/1086/events","html_url":"https://github.com/felixge/node-mysql/issues/1086","id":75226229,"number":1086,"title":"Unescape mysql functions","user":{"login":"shaoner","id":151812,"avatar_url":"https://avatars.githubusercontent.com/u/151812?v=3","gravatar_id":"","url":"https://api.github.com/users/shaoner","html_url":"https://github.com/shaoner","followers_url":"https://api.github.com/users/shaoner/followers","following_url":"https://api.github.com/users/shaoner/following{/other_user}","gists_url":"https://api.github.com/users/shaoner/gists{/gist_id}","starred_url":"https://api.github.com/users/shaoner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaoner/subscriptions","organizations_url":"https://api.github.com/users/shaoner/orgs","repos_url":"https://api.github.com/users/shaoner/repos","events_url":"https://api.github.com/users/shaoner/events{/privacy}","received_events_url":"https://api.github.com/users/shaoner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/felixge/node-mysql/labels/question","name":"question","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-05-11T13:39:52Z","updated_at":"2015-05-11T16:37:21Z","closed_at":null,"body":"Hi,\r\n\r\nSimple question, I was wondering if it would make sense to have the ability to \"unescape\" values while using `format`.\r\nIt may sound ridiculous, but using format with an array or an object is pretty convenient, and you may want some values to be \"unescaped\" (especially MySQL functions):\r\n\r\n```javascript\r\nconnection.query('INSERT INTO ?? (??) VALUES ?', [ 'table', [ 'field1', 'field2', 'field2' ], [ [ 1, 2, 'DEFAULT' ], [ 'DEFAULT', 3, 4 ] ])\r\n```\r\n\r\nor\r\n\r\n```javascript\r\nconnection.query('INSERT INTO ?? SET ?', [ 'table', { field1: 1, field2: 2, field3: 'NOW()'  } ])\r\n```\r\n\r\nOf course, I could use my own formatter or create the query string myself. I just wanted to bring the idea on the table. Maybe by providing a function as a value ?\r\n\r\n```javascript\r\nconnection.query('INSERT INTO ?? SET ?', [ 'table', { field1: 1, field2: 2, field3: function () { return 'NOW()'; }  } ])\r\n```\r\n\r\nCons: It doesn't seem very natural to use '?' as a placeholder to something which is finally not escaped, so maybe there are better ideas to achieve this, or maybe the whole feature would be a bad idea in a low-level module after all."},"comment":{"url":"https://api.github.com/repos/felixge/node-mysql/issues/comments/100973507","html_url":"https://github.com/felixge/node-mysql/issues/1086#issuecomment-100973507","issue_url":"https://api.github.com/repos/felixge/node-mysql/issues/1086","id":100973507,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T16:37:21Z","updated_at":"2015-05-11T16:37:21Z","body":"You may actually want to use an actual query builder like https://hiddentao.github.io/squel/"}}