{"action":"closed","issue":{"url":"https://api.github.com/repos/vapor/fluent/issues/366","repository_url":"https://api.github.com/repos/vapor/fluent","labels_url":"https://api.github.com/repos/vapor/fluent/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/vapor/fluent/issues/366/comments","events_url":"https://api.github.com/repos/vapor/fluent/issues/366/events","html_url":"https://github.com/vapor/fluent/issues/366","id":293134761,"number":366,"title":"Raw APIs in Fluent","user":{"login":"Joannis","id":1951674,"avatar_url":"https://avatars2.githubusercontent.com/u/1951674?v=4","gravatar_id":"","url":"https://api.github.com/users/Joannis","html_url":"https://github.com/Joannis","followers_url":"https://api.github.com/users/Joannis/followers","following_url":"https://api.github.com/users/Joannis/following{/other_user}","gists_url":"https://api.github.com/users/Joannis/gists{/gist_id}","starred_url":"https://api.github.com/users/Joannis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joannis/subscriptions","organizations_url":"https://api.github.com/users/Joannis/orgs","repos_url":"https://api.github.com/users/Joannis/repos","events_url":"https://api.github.com/users/Joannis/events{/privacy}","received_events_url":"https://api.github.com/users/Joannis/received_events","type":"User","site_admin":false},"labels":[{"id":317684743,"url":"https://api.github.com/repos/vapor/fluent/labels/enhancement","name":"enhancement","color":"1d76db","default":true}],"state":"closed","locked":false,"assignee":{"login":"tanner0101","id":1342803,"avatar_url":"https://avatars2.githubusercontent.com/u/1342803?v=4","gravatar_id":"","url":"https://api.github.com/users/tanner0101","html_url":"https://github.com/tanner0101","followers_url":"https://api.github.com/users/tanner0101/followers","following_url":"https://api.github.com/users/tanner0101/following{/other_user}","gists_url":"https://api.github.com/users/tanner0101/gists{/gist_id}","starred_url":"https://api.github.com/users/tanner0101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanner0101/subscriptions","organizations_url":"https://api.github.com/users/tanner0101/orgs","repos_url":"https://api.github.com/users/tanner0101/repos","events_url":"https://api.github.com/users/tanner0101/events{/privacy}","received_events_url":"https://api.github.com/users/tanner0101/received_events","type":"User","site_admin":false},"assignees":[{"login":"tanner0101","id":1342803,"avatar_url":"https://avatars2.githubusercontent.com/u/1342803?v=4","gravatar_id":"","url":"https://api.github.com/users/tanner0101","html_url":"https://github.com/tanner0101","followers_url":"https://api.github.com/users/tanner0101/followers","following_url":"https://api.github.com/users/tanner0101/following{/other_user}","gists_url":"https://api.github.com/users/tanner0101/gists{/gist_id}","starred_url":"https://api.github.com/users/tanner0101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanner0101/subscriptions","organizations_url":"https://api.github.com/users/tanner0101/orgs","repos_url":"https://api.github.com/users/tanner0101/repos","events_url":"https://api.github.com/users/tanner0101/events{/privacy}","received_events_url":"https://api.github.com/users/tanner0101/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-01-31T12:08:58Z","updated_at":"2018-03-27T20:35:46Z","closed_at":"2018-03-27T20:35:46Z","author_association":"MEMBER","body":"The old `raw` API wasn't ideal because it showed too many limitations. Although, I believe we can now create a `RawQuerySupporting` protocol that a connection or database can rely upon. That way the raw queries can still be supported using generics. \r\n\r\nFor MongoDB:\r\n\r\n```swift\r\nextension MongoDB: RawQuerySupporting {\r\n  typealias Raw = Document\r\n\r\n  func raw(_ query: Raw) -> Stream<RawResults> { ... }\r\n}\r\n```\r\n\r\nFor SQL:\r\n\r\n```swift\r\nextension MySQL: RawQuerySupporting {\r\n  typealias Raw = String\r\n\r\n  func raw(_ query: Raw) -> Stream<RawResults> { ... }\r\n}\r\n```\r\n\r\nI don't know for sure if this is a must-have, but it'd definitely improve complex (officially unsupported) situations a bit."}}
{"actor":{"display_login":"tanner0101"}}