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

io.getquill.context.qzio.ZioTranslateContext.scala Maven / Gradle / Ivy

The newest version!
package io.getquill.context.qzio

import io.getquill.NamingStrategy
import io.getquill.context.{Context, ContextTranslateMacro}
import io.getquill.idiom.Idiom
import zio.ZIO

trait ZioTranslateContext extends ContextTranslateMacro {
  this: Context[_ <: Idiom, _ <: NamingStrategy] =>

  type Error
  type Environment

  override type TranslateResult[T] = ZIO[Environment, Error, T]
  override def wrap[T](t: => T): TranslateResult[T]                                  = ZIO.environment[Environment].as(t)
  override def push[A, B](result: TranslateResult[A])(f: A => B): TranslateResult[B] = result.map(f)
  override def seq[A](list: List[TranslateResult[A]]): TranslateResult[List[A]]      = ZIO.collectAll(list)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy