{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4273","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4273/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4273/comments","events_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4273/events","html_url":"https://github.com/jOOQ/jOOQ/issues/4273","id":73560618,"number":4273,"title":"Add implicit ScalaDSLContext type to add additional functionality to DSLContext for Scala users","user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20Functionality","name":"C: Functionality","color":"0000aa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20Integration:%20Scala","name":"C: Integration: Scala","color":"0000aa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/P:%20Medium","name":"P: Medium","color":"ffaaaa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/T:%20Enhancement","name":"T: Enhancement","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/111","html_url":"https://github.com/jOOQ/jOOQ/milestones/Version%203.7.0","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/111/labels","id":900413,"number":111,"title":"Version 3.7.0","description":"","creator":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":274,"closed_issues":35,"state":"open","created_at":"2014-12-11T12:56:14Z","updated_at":"2015-05-06T09:59:38Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-05-06T08:45:54Z","updated_at":"2015-05-06T10:16:02Z","closed_at":null,"body":"E.g.\r\n\r\n```scala\r\n  implicit class ScalaDSLContext(val ctx : DSLContext) {\r\n    def fetchOneOption[R <: Record](query : ResultQuery[R]) : Option[R] = Option(ctx.fetchOne(query)) \r\n  }\r\n```\r\n\r\nSee also:\r\n- https://github.com/jOOQ/jOOQ/issues/4203#issuecomment-99018768\r\n- #4271"},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/comments/99407704","html_url":"https://github.com/jOOQ/jOOQ/issues/4273#issuecomment-99407704","issue_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4273","id":99407704,"user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T10:16:02Z","updated_at":"2015-05-06T10:16:02Z","body":"This is the projected API:\r\n\r\n```scala\r\n  implicit class ScalaDSLContext (val ctx : DSLContext) {\r\n    def fetchAnyOption[R <: Record]          (table : Table[R])                        : Option[R]      = Option(ctx.fetchAny(table))\r\n    def fetchAnyOption[R <: Record]          (table : Table[R], condition : Condition) : Option[R]      = Option(ctx.fetchAny(table, condition))\r\n                                             \r\n    def fetchOneOption[R <: Record]          (query : ResultQuery[R])                  : Option[R]      = Option(ctx.fetchOne(query))\r\n    def fetchOneOption                       (rs : ResultSet)                          : Option[Record] = Option(ctx.fetchOne(rs))\r\n    def fetchOneOption                       (rs : ResultSet, types : Class[_]*)       : Option[Record] = Option(ctx.fetchOne(rs, types:_*))\r\n    def fetchOneOption                       (rs : ResultSet, types : DataType[_]*)    : Option[Record] = Option(ctx.fetchOne(rs, types:_*))\r\n    def fetchOneOption                       (rs : ResultSet, fields : Field[_]*)      : Option[Record] = Option(ctx.fetchOne(rs, fields:_*))\r\n    def fetchOneOption                       (sql : String)                            : Option[Record] = Option(ctx.fetchOne(sql))\r\n    def fetchOneOption                       (sql : String, bindings : AnyRef*)        : Option[Record] = Option(ctx.fetchOne(sql, bindings))\r\n    def fetchOneOption                       (sql : String, parts : QueryPart*)        : Option[Record] = Option(ctx.fetchOne(sql, parts))\r\n    def fetchOneOption[R <: Record]          (table : Table[R])                        : Option[R]      = Option(ctx.fetchOne(table))\r\n    def fetchOneOption[R <: Record]          (table : Table[R], condition : Condition) : Option[R]      = Option(ctx.fetchOne(table, condition))\r\n\r\n    def fetchValueOption[T, R <: Record1[T]] (query : ResultQuery[R])                  : Option[T]      = Option(ctx.fetchValue(query))\r\n    def fetchValueOption                     (rs : ResultSet)                          : Option[AnyRef] = Option(ctx.fetchValue(rs))\r\n    def fetchValueOption[T]                  (rs : ResultSet, newType : Class[T])      : Option[T]      = Option(ctx.fetchValue(rs, newType))\r\n    def fetchValueOption[T]                  (rs : ResultSet, newType : DataType[T])   : Option[T]      = Option(ctx.fetchValue(rs, newType))\r\n    def fetchValueOption[T]                  (rs : ResultSet, field : Field[T])        : Option[T]      = Option(ctx.fetchValue(rs, field))\r\n    def fetchValueOption                     (sql : String)                            : Option[AnyRef] = Option(ctx.fetchValue(sql))\r\n    def fetchValueOption                     (sql : String, bindings : AnyRef*)        : Option[AnyRef] = Option(ctx.fetchValue(sql, bindings))\r\n    def fetchValueOption                     (sql : String, parts : QueryPart*)        : Option[AnyRef] = Option(ctx.fetchValue(sql, parts))\r\n  }\r\n```"}}