{"action":"created","issue":{"url":"https://api.github.com/repos/vitaly-t/pg-promise-demo/issues/2","repository_url":"https://api.github.com/repos/vitaly-t/pg-promise-demo","labels_url":"https://api.github.com/repos/vitaly-t/pg-promise-demo/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/vitaly-t/pg-promise-demo/issues/2/comments","events_url":"https://api.github.com/repos/vitaly-t/pg-promise-demo/issues/2/events","html_url":"https://github.com/vitaly-t/pg-promise-demo/issues/2","id":157063125,"number":2,"title":"Return a result from select command","user":{"login":"mfgabriel92","id":9994477,"avatar_url":"https://avatars.githubusercontent.com/u/9994477?v=3","gravatar_id":"","url":"https://api.github.com/users/mfgabriel92","html_url":"https://github.com/mfgabriel92","followers_url":"https://api.github.com/users/mfgabriel92/followers","following_url":"https://api.github.com/users/mfgabriel92/following{/other_user}","gists_url":"https://api.github.com/users/mfgabriel92/gists{/gist_id}","starred_url":"https://api.github.com/users/mfgabriel92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfgabriel92/subscriptions","organizations_url":"https://api.github.com/users/mfgabriel92/orgs","repos_url":"https://api.github.com/users/mfgabriel92/repos","events_url":"https://api.github.com/users/mfgabriel92/events{/privacy}","received_events_url":"https://api.github.com/users/mfgabriel92/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-26T19:44:21Z","updated_at":"2016-05-27T02:01:29Z","closed_at":null,"body":"Greetings,\r\n\r\nI've followed your instructions on how to properly separate our structure using `pg-promise`, and everything's working fine. I'm building a Slack slash commands using it, and when selecting data from database, I need it to display something like `[username] is [status]`. Following other operation's example, I suppose it would be something like this:\r\n\r\n    select: () =>\r\n        rep.any('SELECT username, status, emoji FROM ' + table)\r\n        .then(res => ?),\r\n\r\nBut I cannot access these columns nor I have found examples of such. Is it possible to be done?\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/vitaly-t/pg-promise-demo/issues/comments/222042463","html_url":"https://github.com/vitaly-t/pg-promise-demo/issues/2#issuecomment-222042463","issue_url":"https://api.github.com/repos/vitaly-t/pg-promise-demo/issues/2","id":222042463,"user":{"login":"mfgabriel92","id":9994477,"avatar_url":"https://avatars.githubusercontent.com/u/9994477?v=3","gravatar_id":"","url":"https://api.github.com/users/mfgabriel92","html_url":"https://github.com/mfgabriel92","followers_url":"https://api.github.com/users/mfgabriel92/followers","following_url":"https://api.github.com/users/mfgabriel92/following{/other_user}","gists_url":"https://api.github.com/users/mfgabriel92/gists{/gist_id}","starred_url":"https://api.github.com/users/mfgabriel92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfgabriel92/subscriptions","organizations_url":"https://api.github.com/users/mfgabriel92/orgs","repos_url":"https://api.github.com/users/mfgabriel92/repos","events_url":"https://api.github.com/users/mfgabriel92/events{/privacy}","received_events_url":"https://api.github.com/users/mfgabriel92/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T02:01:29Z","updated_at":"2016-05-27T02:01:29Z","body":"Maybe what I am trying to accomplish is made differently.\r\n\r\nThe code `select: () => rep.any('SELECT username, status, emoji FROM status')` returns `[{\"username\":\"gabrielmf\",\"status\":\"OUT\",\"emoji\":\"runner\"}]` on Slack channel. What I intended to do was to, instead of display the result like this, to display it in a better way, like this:\r\n\r\n> gabrielmf is OUT :runner: \r\n> anotheruser is HUNRY :spaghetti: \r\n> ...\r\n\r\nI tried to follow the examples of the other operations and to use `db.each`. By adding `.then(data => data)` after the snipped above, it returned the same result it does now without it, and nothing was returned when accessing, for example, `data.username`."}}
{"actor":{"display_login":"mfgabriel92"}}