{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/1353","repository_url":"https://api.github.com/repos/tgriesser/bookshelf","labels_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/1353/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/1353/comments","events_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/1353/events","html_url":"https://github.com/tgriesser/bookshelf/issues/1353","id":172565568,"number":1353,"title":"Build mandatory requests into model.","user":{"login":"wjagodfrey","id":5732688,"avatar_url":"https://avatars.githubusercontent.com/u/5732688?v=3","gravatar_id":"","url":"https://api.github.com/users/wjagodfrey","html_url":"https://github.com/wjagodfrey","followers_url":"https://api.github.com/users/wjagodfrey/followers","following_url":"https://api.github.com/users/wjagodfrey/following{/other_user}","gists_url":"https://api.github.com/users/wjagodfrey/gists{/gist_id}","starred_url":"https://api.github.com/users/wjagodfrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjagodfrey/subscriptions","organizations_url":"https://api.github.com/users/wjagodfrey/orgs","repos_url":"https://api.github.com/users/wjagodfrey/repos","events_url":"https://api.github.com/users/wjagodfrey/events{/privacy}","received_events_url":"https://api.github.com/users/wjagodfrey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-22T22:00:31Z","updated_at":"2016-08-22T23:21:05Z","closed_at":null,"body":"This issue is coming from a place of frustration - after wasting hours trying to get bookshelf to conform to a [\"legacy\" postgres schema](https://github.com/tgriesser/bookshelf/issues/363#issuecomment-241287259), I have resorted for a few relationships to placing additional requests and subsequent data manipulation on top the usual set of Model fetch calls. This is a pain though. I have nested circular relationships with the same model, with polymorphic mapping (Node has many Nodes, Nodes can be Story, Image, Video, etc). It happens after my mapping, so in most cases I have to continue to expose foreign keys and then strip them manually. The whole process is far less pleasant than I would like.\r\n\r\nI want a way, if nothing else, to build a mandatory request into a model that is called, and the data from the request injected into the returned data, before parsing, every time it is called. The request would have to be based on parameters being returned by the initial fetch call on the model.\r\n\r\nWe can get into why, but that would require digging through a long list of frustrations, and I am looking for the simplest solution at this point. Time is running out.\r\n\r\nAn attribute would seem to be the way to do this, but the attribute would need access to the properties returned by the first request, and before parsing. If there is a way of doing this please let me know.\r\n\r\nParsing may also have been the place to do this, but parsing doesn't seem to support async parses.\r\n\r\nThanks,\r\nWilfred"},"comment":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/comments/241580789","html_url":"https://github.com/tgriesser/bookshelf/issues/1353#issuecomment-241580789","issue_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/1353","id":241580789,"user":{"login":"jordansexton","id":1173161,"avatar_url":"https://avatars.githubusercontent.com/u/1173161?v=3","gravatar_id":"","url":"https://api.github.com/users/jordansexton","html_url":"https://github.com/jordansexton","followers_url":"https://api.github.com/users/jordansexton/followers","following_url":"https://api.github.com/users/jordansexton/following{/other_user}","gists_url":"https://api.github.com/users/jordansexton/gists{/gist_id}","starred_url":"https://api.github.com/users/jordansexton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordansexton/subscriptions","organizations_url":"https://api.github.com/users/jordansexton/orgs","repos_url":"https://api.github.com/users/jordansexton/repos","events_url":"https://api.github.com/users/jordansexton/events{/privacy}","received_events_url":"https://api.github.com/users/jordansexton/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T23:21:04Z","updated_at":"2016-08-22T23:21:04Z","body":"I'm familiar with that issue and commented on it some time ago. As the OP of that issue mentioned initially, no ORM supports that feature. If you want that feature, you may have to implement it. The clear desire for the feature you assert does not clearly exist to me. Rather, it's a somewhat esoteric feature of one RDMBS, that is unsupported by any of the ORMs @simg evaluated. If you look at https://github.com/tgriesser/knex/issues/1471, you can see that @rkoberg shows how do it in SQL. That's about as close as you're going to get without a lot of work being done on this feature, work that no one has an _obvious_ interest in actually doing.\r\n\r\nBack to this issue, you used the term \"mandatory request\" which is a term that has no obvious contextual meaning. That's why I asked for context of what you're trying to do. I have no idea what that is at this point. There are plenty of reasons to be disappointed with any library, and plenty of things that Bookshelf can't do, but this is neither here nor there. No one can help you if you aren't specific about what the issue you're running into is, and a determination of the relevance to Bookshelf matters because that's what this this. If it's the aforementioned one (Postgres arrays), the answer is simple: few people are using them, they have not been implemented in Bookshelf or any notable ORM I know of, and they aren't likely to be added in a timeframe that is useful to you if you're in a hurry."}}
{"actor":{"display_login":"jordansexton"}}