All Downloads are FREE. Search and download functionalities are using the official Maven repository.

liewhite.sqlx.DBContext.scala Maven / Gradle / Ivy

There is a newer version: 4.2.3
Show newest version
package liewhite.sqlx

import zio.ZIO
import zio.ZLayer
import org.jooq.impl.DefaultDSLContext
import org.jooq.DSLContext

class DBContext(val ds: DBDataSource) {
  val ctx = new DefaultDSLContext(ds.datasource, ds.dialect)
}

object DBContext {
  def layer: ZLayer[DBDataSource, Nothing, DSLContext] =
    ZLayer(ZIO.service[DBDataSource].map(DBContext(_).ctx))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy