payload: {"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/3031","repository_url":"https://api.github.com/repos/tgriesser/knex","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/3031/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/3031/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/3031/events","html_url":"https://github.com/tgriesser/knex/issues/3031","id":406570359,"node_id":"MDU6SXNzdWU0MDY1NzAzNTk=","number":3031,"title":"Returning doesn't work with insert on MySQL","user":{"login":"michaelh-mg","id":32180583,"node_id":"MDQ6VXNlcjMyMTgwNTgz","avatar_url":"https://avatars1.githubusercontent.com/u/32180583?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelh-mg","html_url":"https://github.com/michaelh-mg","followers_url":"https://api.github.com/users/michaelh-mg/followers","following_url":"https://api.github.com/users/michaelh-mg/following{/other_user}","gists_url":"https://api.github.com/users/michaelh-mg/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelh-mg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelh-mg/subscriptions","organizations_url":"https://api.github.com/users/michaelh-mg/orgs","repos_url":"https://api.github.com/users/michaelh-mg/repos","events_url":"https://api.github.com/users/michaelh-mg/events{/privacy}","received_events_url":"https://api.github.com/users/michaelh-mg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2019-02-04T23:45:27Z","updated_at":"2019-02-12T06:12:14Z","closed_at":"2019-02-05T00:15:57Z","author_association":"NONE","body":"# Environment\r\n\r\nKnex version: `0.16.2`\r\nDatabase + version: MySQL 5.6.42\r\nOS: Node Docker container running on MacOS Mojave 10.14.2\r\n\r\nSelect applicable tempalate from below.\r\nIf issue is about oracledb support tag @ atiertant. For MSSql tag @ smorey2 .\r\nRest of dialects doesn't need tags.\r\n\r\n# Bug\r\n\r\nWhen doing an `insert` with `returning`, the fields specified in `returning` are not returned. Instead, just the `id` is returned.\r\n\r\n## Example\r\n```typescript\r\nreturn this.db\r\n      .transaction(trx =>\r\n        trx\r\n          .withSchema(\"schema_name\")\r\n          .into(\"installation\")\r\n          .insert(inst, [\"id\", \"app_version\"])\r\n      )\r\n```\r\n**OR**\r\n```typescript\r\nreturn this.db\r\n      .transaction(trx =>\r\n        trx\r\n          .withSchema(\"schema_name\")\r\n          .into(\"installation\")\r\n          .insert(inst)\r\n          .returning([\"id\", \"app_version\"])\r\n      )\r\n```\r\nBoth of those examples will only return an array with the generated `id` in it. It won't return the `app_version`.\r\n\r\n### Actual Return Value\r\n```typescript\r\n[ 0 ]\r\n```\r\n\r\n### Expected Return Value\r\n```typescript\r\n[ { id: 0, app_version: \"1.0.1\" } ]\r\n```\r\n\r\n_NOTE: I'm aware that `.returning` will not work for multiple inserts with MySQL. I was only attempting single inserts when this bug manifested._"},"comment":{"url":"https://api.github.com/repos/tgriesser/knex/issues/comments/462629907","html_url":"https://github.com/tgriesser/knex/issues/3031#issuecomment-462629907","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/3031","id":462629907,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2MjYyOTkwNw==","user":{"login":"elhigu","id":696345,"node_id":"MDQ6VXNlcjY5NjM0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/696345?v=4","gravatar_id":"","url":"https://api.github.com/users/elhigu","html_url":"https://github.com/elhigu","followers_url":"https://api.github.com/users/elhigu/followers","following_url":"https://api.github.com/users/elhigu/following{/other_user}","gists_url":"https://api.github.com/users/elhigu/gists{/gist_id}","starred_url":"https://api.github.com/users/elhigu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elhigu/subscriptions","organizations_url":"https://api.github.com/users/elhigu/orgs","repos_url":"https://api.github.com/users/elhigu/repos","events_url":"https://api.github.com/users/elhigu/events{/privacy}","received_events_url":"https://api.github.com/users/elhigu/received_events","type":"User","site_admin":false},"created_at":"2019-02-12T06:12:14Z","updated_at":"2019-02-12T06:12:14Z","author_association":"COLLABORATOR","body":"@skunca that has nothing to do with this issue. You can open new feature request about it where to discuss it further. Afaik getting id of single inserted row has never been a problem even with mysql."}}
other: {"actor":{"display_login":"elhigu"}}