{"action":"created","issue":{"url":"https://api.github.com/repos/groue/GRDB.swift/issues/303","repository_url":"https://api.github.com/repos/groue/GRDB.swift","labels_url":"https://api.github.com/repos/groue/GRDB.swift/issues/303/labels{/name}","comments_url":"https://api.github.com/repos/groue/GRDB.swift/issues/303/comments","events_url":"https://api.github.com/repos/groue/GRDB.swift/issues/303/events","html_url":"https://github.com/groue/GRDB.swift/issues/303","id":296395583,"number":303,"title":"Cursor, Sequence, IteratorProtocol","user":{"login":"sobri909","id":1203835,"avatar_url":"https://avatars0.githubusercontent.com/u/1203835?v=4","gravatar_id":"","url":"https://api.github.com/users/sobri909","html_url":"https://github.com/sobri909","followers_url":"https://api.github.com/users/sobri909/followers","following_url":"https://api.github.com/users/sobri909/following{/other_user}","gists_url":"https://api.github.com/users/sobri909/gists{/gist_id}","starred_url":"https://api.github.com/users/sobri909/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sobri909/subscriptions","organizations_url":"https://api.github.com/users/sobri909/orgs","repos_url":"https://api.github.com/users/sobri909/repos","events_url":"https://api.github.com/users/sobri909/events{/privacy}","received_events_url":"https://api.github.com/users/sobri909/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-02-12T14:35:04Z","updated_at":"2018-02-12T18:27:49Z","closed_at":"2018-02-12T18:16:53Z","author_association":"NONE","body":"I've got a minor memory leak problem. Which I'm 99.9% sure is just a random dumb line of code somewhere that I haven't spotted yet, entirely unrelated to the db layer. But it's given me a semi plausible excuse to turn my result arrays into lazy collections. Basically I'm bike shedding an unnecessary optimisation, because fun. \r\n\r\nI noticed the other day you pushed [this commit](https://github.com/groue/GRDB.swift/pull/297). Which I took as an indication that you were pre-empting my bike shedding. But it looks like you've stopped just short of the end goal? Unless I'm missing something, I'm not seeing any direct interface for turning a cursor into a `Sequence, IteratorProtocol` result.\r\n\r\nWhich isn't a major problem, because you've more than provided all the necessary ingredients to do so with a tiny wrapper. I'm just wondering if there's a reason why you haven't already. Is there some fundamental potential disaster that I'm missing?\r\n\r\nAs always, thanks for providing me the gateway tools to indulge my entirely unnecessary SQL/ORM feature building desires ;)"},"comment":{"url":"https://api.github.com/repos/groue/GRDB.swift/issues/comments/365015988","html_url":"https://github.com/groue/GRDB.swift/issues/303#issuecomment-365015988","issue_url":"https://api.github.com/repos/groue/GRDB.swift/issues/303","id":365015988,"user":{"login":"groue","id":54219,"avatar_url":"https://avatars2.githubusercontent.com/u/54219?v=4","gravatar_id":"","url":"https://api.github.com/users/groue","html_url":"https://github.com/groue","followers_url":"https://api.github.com/users/groue/followers","following_url":"https://api.github.com/users/groue/following{/other_user}","gists_url":"https://api.github.com/users/groue/gists{/gist_id}","starred_url":"https://api.github.com/users/groue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groue/subscriptions","organizations_url":"https://api.github.com/users/groue/orgs","repos_url":"https://api.github.com/users/groue/repos","events_url":"https://api.github.com/users/groue/events{/privacy}","received_events_url":"https://api.github.com/users/groue/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T18:27:49Z","updated_at":"2018-02-12T18:27:49Z","author_association":"OWNER","body":"> I still think you should write your own Sequence, IteratorProtocol wrapper though\r\n\r\nAbsolutely not. As you have shown, it is trivial to write such a wrapper. And shoot yourself in the foot because once you keave the trivial zone, your \"safe\" iterator and all the brittle cathedral you've built around it will fall in pieces. I don't think cursors are inconvenient. They do exactly the job they are made for. No more, no less. In a plain and boring fashion. The recipe for honest and composable software bricks. Your wrapper has all reasons to exist, but in userland, at the app level."}}
{"actor":{"display_login":"groue"}}