Skip to content

Instantly share code, notes, and snippets.

View Krever's full-sized avatar

Voytek Pituła Krever

View GitHub Profile
trait PostgresExtension {
val ctx: QuillCtx
import ctx._
implicit val jsonDecoder: Decoder[JsonObject] =
decoder(
(index, row) =>
io.circe.parser.decode[JsonObject](row.getObject(index).toString) match {
case Left(failure) => throw failure
import magnolia._
object MagnoliaTest {
trait TCA[T] {
def showA: String
}
trait TCB[T] {
def showB: String
}
//simplified logger from scala-logging
trait LoggerTakingImplicit[T] {
def log(msg: String)(implicit ev: CanLog[T])
}
trait CanLog[T] {
def logMessage(originalMsg: String, a: T): String
}
import java.io._
import io.circe._
import scala.collection.mutable.ListBuffer
import scala.io.Source
import scala.language.higherKinds
import scala.util.{Failure, Success, Try}
trait Codec[T] {
import BasicAuthAlgebra.Credentials
trait Algebra {
type Endpoint[Req, Resp]
type Request[T]
type RequestHeaders[T]
type Path[T]
type RequestBody[T]
type Method
type Response[T]