![JAR search and dependency download from the Maven repository](/logo.png)
scoobie.doobie.doo.postgres.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scoobie-contrib-doobie41-postgres_2.12 Show documentation
Show all versions of scoobie-contrib-doobie41-postgres_2.12 Show documentation
Introduces doobie support to scoobie with postgres.
The newest version!
package scoobie.doobie.doo
import doobie.imports._
import scoobie.coercion.Coerce
import scoobie.doobie.doo.ansi.SqlInterpreter.LiteralQueryString
import scoobie.doobie.doo.ansi._
import scoobie.doobie.{DoobieSqlInterpreter, DoobieSupport, ScoobieFragmentProducer}
/**
* Created by jbarber on 5/20/16.
*/
object postgres extends DoobieSupport {
implicit val fragmentLifter =
new SqlQueryLifter[ScoobieFragmentProducer, Fragment] {
def liftValue[A](a: A, fa: ScoobieFragmentProducer[A]): Fragment = fa.genFragment(a)
}
implicit val scoobieFragmentProducerForLiteralQueryString: ScoobieFragmentProducer[LiteralQueryString] =
ScoobieFragmentProducer[LiteralQueryString](s => new StringContext(s.s).fr0.apply())
val interpreter: SqlInterpreter[ScoobieFragmentProducer, Fragment] = SqlInterpreter[ScoobieFragmentProducer, Fragment]("\"")
implicit val doobieInterpreter = DoobieSqlInterpreter(interpreter.interpretSql(_))
implicit val coercetoScoobieFragmentProducer: Coerce[ScoobieFragmentProducer] = scoobie.doobie.doobieCoercer
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy