This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.getquill._ | |
import io.getquill.context.sql.norm._ | |
import io.getquill.norm.capture.AvoidCapture | |
import io.getquill.ast._ | |
import io.getquill.norm._ | |
import io.getquill.context.sql._ | |
import scala.annotation.tailrec | |
import io.getquill.context.sql.idiom.VerifySqlQuery | |
import io.getquill.norm.capture.DemarcateExternalAliases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.getquill | |
import io.getquill.context.ContextEffect | |
import io.getquill.context.jdbc.JdbcContextBase | |
import io.getquill.context.sql.idiom.SqlIdiom | |
// Need this to be able to defined 'effect' since that's a package-private so this file needs to reside in the | |
// `io.getquill` package but it's the only thing that does. | |
trait JdbcContextBaseStub[Dialect <: SqlIdiom, Naming <: NamingStrategy] extends JdbcContextBase[Dialect, Naming] { | |
private[getquill] val effect: ContextEffect[Result] = null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample report base-class: | |
trait Report { | |
type T | |
def apply(runtimeConf:MyConf)(encoder:spark.sql.Encoder[T]):Unit | |
} | |
// Sample implementation: | |
class OrdersReport { | |
type T = OrderRecord | |
def runReport(runtimeConf:MyConf)(encoder:spark.sql.Encoder[OrderRecord]):Unit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CaseClassHListShapeQueryExample { | |
final class HListShape[Level <: ShapeLevel, M <: HList, U <: HList : ClassTag, P <: HList](val shapes: Seq[Shape[_, _, _, _]]) extends MappedScalaProductShape[Level, HList, M, U, P] { | |
def buildValue(elems: IndexedSeq[Any]) = elems.foldRight(HNil: HList)(_ :: _) | |
def copy(shapes: Seq[Shape[_ <: ShapeLevel, _, _, _]]) = new HListShape(shapes) | |
} | |
implicit def hnilShape[Level <: ShapeLevel] = new HListShape[Level, HNil.type, HNil.type, HNil.type](Nil) | |
implicit def hconsShape[Level <: ShapeLevel, M1, M2 <: HList, U1, U2 <: HList, P1, P2 <: HList](implicit s1: Shape[_ <: Level, M1, U1, P1], s2: HListShape[_ <: Level, M2, U2, P2]) = | |
new HListShape[Level, M1 :: M2, U1 :: U2, P1 :: P2](s1 +: s2.shapes) |
NewerOlder