{"action":"created","issue":{"url":"https://api.github.com/repos/hamiltop/rethinkdb-elixir/issues/90","repository_url":"https://api.github.com/repos/hamiltop/rethinkdb-elixir","labels_url":"https://api.github.com/repos/hamiltop/rethinkdb-elixir/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/hamiltop/rethinkdb-elixir/issues/90/comments","events_url":"https://api.github.com/repos/hamiltop/rethinkdb-elixir/issues/90/events","html_url":"https://github.com/hamiltop/rethinkdb-elixir/issues/90","id":128365077,"number":90,"title":"Suggestion: return an atom indicating the response rather than a struct","user":{"login":"robconery","id":78586,"avatar_url":"https://avatars.githubusercontent.com/u/78586?v=3","gravatar_id":"","url":"https://api.github.com/users/robconery","html_url":"https://github.com/robconery","followers_url":"https://api.github.com/users/robconery/followers","following_url":"https://api.github.com/users/robconery/following{/other_user}","gists_url":"https://api.github.com/users/robconery/gists{/gist_id}","starred_url":"https://api.github.com/users/robconery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robconery/subscriptions","organizations_url":"https://api.github.com/users/robconery/orgs","repos_url":"https://api.github.com/users/robconery/repos","events_url":"https://api.github.com/users/robconery/events{/privacy}","received_events_url":"https://api.github.com/users/robconery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-01-24T01:21:20Z","updated_at":"2016-06-13T14:14:34Z","closed_at":null,"body":"Right now when I get a query back I need to match on one of the structs `RethinkDB.Response`, `RethinkDB.Collection` or `RethinkDB.Record`. The problem I'm running into is a tad convoluted - but the basics are that I'm trying to catch some errors.\r\n\r\nRight now all the structs match on `%{data: data}`, which means that if I want to pipe the query results through to any other functions I need to match on 3 separate function heads (one for each struct). It makes things a bit unclear.\r\n\r\nI can see the reasoning for each struct (allowing for enumerable, etc) but I can also see a benefit in just handing the data back as pure data:\r\n\r\n```\r\n{:ok, data: []}\r\n{:error, message:message}\r\n```\r\n\r\nIt would help tremendously! As with the other issue I just logged this would be a breaking change - but I just thought I'd ask :)."},"comment":{"url":"https://api.github.com/repos/hamiltop/rethinkdb-elixir/issues/comments/225593409","html_url":"https://github.com/hamiltop/rethinkdb-elixir/issues/90#issuecomment-225593409","issue_url":"https://api.github.com/repos/hamiltop/rethinkdb-elixir/issues/90","id":225593409,"user":{"login":"AdamBrodzinski","id":1445367,"avatar_url":"https://avatars.githubusercontent.com/u/1445367?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamBrodzinski","html_url":"https://github.com/AdamBrodzinski","followers_url":"https://api.github.com/users/AdamBrodzinski/followers","following_url":"https://api.github.com/users/AdamBrodzinski/following{/other_user}","gists_url":"https://api.github.com/users/AdamBrodzinski/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamBrodzinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamBrodzinski/subscriptions","organizations_url":"https://api.github.com/users/AdamBrodzinski/orgs","repos_url":"https://api.github.com/users/AdamBrodzinski/repos","events_url":"https://api.github.com/users/AdamBrodzinski/events{/privacy}","received_events_url":"https://api.github.com/users/AdamBrodzinski/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T14:14:34Z","updated_at":"2016-06-13T14:14:34Z","body":"Awesome, i'll try this out this week. I think this will solve 90% of the issues and a helper can still go the remaining 10% to fit the use case.\r\n\r\nAlso worth mentioning... perhaps having a tuple with `{status, documents, struct}` would be as easy and still provide an easy way to pick out just data?\r\n\r\nCurrently i'm using this `run` helper to get similar functionality (also handles `return_changes`):\r\nhttps://github.com/AdamBrodzinski/awesome-stack/blob/phoenix-1.2-new-graphql/server/lib/db/helpers.ex#L9\r\n\r\n```\r\ntable('users') \r\n  |> DB.Helpers.run\r\n\r\n>> {:ok, [{name: \"Jane\"}, {name: \"Bob\"}]}\r\n```"}}
{"actor":{"display_login":"AdamBrodzinski"}}