{"action":"closed","issue":{"url":"https://api.github.com/repos/purebred-mua/purebred/issues/130","repository_url":"https://api.github.com/repos/purebred-mua/purebred","labels_url":"https://api.github.com/repos/purebred-mua/purebred/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/purebred-mua/purebred/issues/130/comments","events_url":"https://api.github.com/repos/purebred-mua/purebred/issues/130/events","html_url":"https://github.com/purebred-mua/purebred/issues/130","id":281648981,"number":130,"title":"create `withDatabase` helper function","user":{"login":"frasertweedale","id":2331938,"avatar_url":"https://avatars2.githubusercontent.com/u/2331938?v=4","gravatar_id":"","url":"https://api.github.com/users/frasertweedale","html_url":"https://github.com/frasertweedale","followers_url":"https://api.github.com/users/frasertweedale/followers","following_url":"https://api.github.com/users/frasertweedale/following{/other_user}","gists_url":"https://api.github.com/users/frasertweedale/gists{/gist_id}","starred_url":"https://api.github.com/users/frasertweedale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frasertweedale/subscriptions","organizations_url":"https://api.github.com/users/frasertweedale/orgs","repos_url":"https://api.github.com/users/frasertweedale/repos","events_url":"https://api.github.com/users/frasertweedale/events{/privacy}","received_events_url":"https://api.github.com/users/frasertweedale/received_events","type":"User","site_admin":false},"labels":[{"id":729095346,"url":"https://api.github.com/repos/purebred-mua/purebred/labels/easyfix","name":"easyfix","color":"304b9b","default":false},{"id":706325535,"url":"https://api.github.com/repos/purebred-mua/purebred/labels/refactor","name":"refactor","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-12-13T07:25:15Z","updated_at":"2017-12-16T04:46:02Z","closed_at":"2017-12-16T04:46:01Z","author_association":"OWNER","body":"We have a bunch of uses of `bracketT` that just open a database, do the thing, then close\r\nthe database.  We should extract a helper function for this use case.\r\n\r\nIn `src/Storage/Notmuch.hs`:\r\n```\r\n64:  bracketT (Notmuch.databaseOpenReadOnly (view nmDatabase settings)) Notmuch.databaseDestroy go\r\n74:  bracketT (Notmuch.databaseOpenReadOnly dbpath) Notmuch.databaseDestroy go\r\n85:  bracketT (Notmuch.databaseOpen dbpath) Notmuch.databaseDestroy (tagsToMessage nmtags (view mailId m))\r\n96:  void $ bracketT (Notmuch.databaseOpen dbpath) Notmuch.databaseDestroy (go tgs mgs)\r\n149:  bracketT (Notmuch.databaseOpenReadOnly (view nmDatabase settings)) Notmuch.databaseDestroy go\r\n164:  bracketT (Notmuch.databaseOpenReadOnly fp) Notmuch.databaseDestroy go\r\n```"}}
{"actor":{"display_login":"romanofski"}}