{"action":"created","issue":{"url":"https://api.github.com/repos/tomjaguarpaw/haskell-opaleye/issues/200","repository_url":"https://api.github.com/repos/tomjaguarpaw/haskell-opaleye","labels_url":"https://api.github.com/repos/tomjaguarpaw/haskell-opaleye/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/tomjaguarpaw/haskell-opaleye/issues/200/comments","events_url":"https://api.github.com/repos/tomjaguarpaw/haskell-opaleye/issues/200/events","html_url":"https://github.com/tomjaguarpaw/haskell-opaleye/issues/200","id":174934246,"number":200,"title":"Reducing boilerplate","user":{"login":"saurabhnanda","id":28369,"avatar_url":"https://avatars.githubusercontent.com/u/28369?v=3","gravatar_id":"","url":"https://api.github.com/users/saurabhnanda","html_url":"https://github.com/saurabhnanda","followers_url":"https://api.github.com/users/saurabhnanda/followers","following_url":"https://api.github.com/users/saurabhnanda/following{/other_user}","gists_url":"https://api.github.com/users/saurabhnanda/gists{/gist_id}","starred_url":"https://api.github.com/users/saurabhnanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saurabhnanda/subscriptions","organizations_url":"https://api.github.com/users/saurabhnanda/orgs","repos_url":"https://api.github.com/users/saurabhnanda/repos","events_url":"https://api.github.com/users/saurabhnanda/events{/privacy}","received_events_url":"https://api.github.com/users/saurabhnanda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-04T06:32:08Z","updated_at":"2016-09-04T17:28:26Z","closed_at":null,"body":"Referring to https://github.com/nomicflux/servant-opaleye-blog/blob/lesson2_opaleye/README.md . Questions:\r\n\r\nDo most Opaleye apps require FOUR data-types for any entity? AppRead, AppWrite, PGRead,. PGWrite? If yes, is there any plan to avoid this boilerplate code for cases where no special behaviour is required? Are there any plans to adopt \"convention over configuration\" (column names map to record field names predictably, PG types map to Haskell types predictably)\r\n\r\nIf there are any invariants that need to be ensured irrespective of where user input is coming from (ie the invariant needn't be part of user-input validation), what is the appropriate place to put such code? The `appToPg` conversion function? "},"comment":{"url":"https://api.github.com/repos/tomjaguarpaw/haskell-opaleye/issues/comments/244616173","html_url":"https://github.com/tomjaguarpaw/haskell-opaleye/issues/200#issuecomment-244616173","issue_url":"https://api.github.com/repos/tomjaguarpaw/haskell-opaleye/issues/200","id":244616173,"user":{"login":"saurabhnanda","id":28369,"avatar_url":"https://avatars.githubusercontent.com/u/28369?v=3","gravatar_id":"","url":"https://api.github.com/users/saurabhnanda","html_url":"https://github.com/saurabhnanda","followers_url":"https://api.github.com/users/saurabhnanda/followers","following_url":"https://api.github.com/users/saurabhnanda/following{/other_user}","gists_url":"https://api.github.com/users/saurabhnanda/gists{/gist_id}","starred_url":"https://api.github.com/users/saurabhnanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saurabhnanda/subscriptions","organizations_url":"https://api.github.com/users/saurabhnanda/orgs","repos_url":"https://api.github.com/users/saurabhnanda/repos","events_url":"https://api.github.com/users/saurabhnanda/events{/privacy}","received_events_url":"https://api.github.com/users/saurabhnanda/received_events","type":"User","site_admin":false},"created_at":"2016-09-04T17:28:26Z","updated_at":"2016-09-04T17:28:26Z","body":"> Here we chose to have a one-to-many mapping (one PG type maps to several haskell types). This is probably also too (or not enough) restrictive for some. I would like a way to work around all the ambiguity opaleye's many-to-many mapping results in because this still affects us. Maybe it's possible, I haven't really thought about it.\r\n\r\nCan you please elaborate this point? Are you referring to 1:1, 1:many, many:many mappings between tables/rows? I was referring to PGInt4 <=> Integer, PGText <=> Text. Aren't there sensible defaults possible for the data-type mappings?"}}
{"actor":{"display_login":"saurabhnanda"}}