Pipeline

class Pipeline[T, A <: ([T] =>> Insert[T] | Update[T])](implicit evidence$1: Type[T], evidence$2: Type[A], x$1: Quotes) extends QuatMaking with QuatMakingBase

Perform the pipeline of creating an insert statement. The 'insertee' is the case class on which the SQL insert statement is based. The schema is based on the EntityQuery which could potentially be an unquoted QuerySchema.

class Object
trait Matchable
class Any

Type members

Classlikes

Is the assignment list know at compile time or only runtime?

Is the assignment list know at compile time or only runtime?

case
class InserteeSchema(schemaRaw: Expr[EntityQuery[T]])
Companion
object
object MacroType
Companion
class

Inherited classlikes

object InferQuat
Inherited from
QuatMakingBase

Value members

Concrete methods

def apply(schemaRaw: Expr[EntityQuery[T]], inserteeRaw: Expr[T]): Expr[A[T]]

Note that the only reason Parser is needed here is to pass it into parseInsertee. The batch pipeline driven by createFromPremade currently doesn't need it.

Note that the only reason Parser is needed here is to pass it into parseInsertee. The batch pipeline driven by createFromPremade currently doesn't need it.

def createQuotation(summonState: EntitySummonState[Ast], assignmentOfEntity: List[Assignment], lifts: List[Expr[Planter[_, _, _]]], pluckedUnquotes: List[Expr[QuotationVase]]): Expr[Quoted[A[T]]]

Create a static or dynamic quotation based on the state. Wrap the expr using some additional functions if we need to. This is used for the createFromPremade if we need to wrap it into insertReturning which is used for batch-returning query execution.

Create a static or dynamic quotation based on the state. Wrap the expr using some additional functions if we need to. This is used for the createFromPremade if we need to wrap it into insertReturning which is used for batch-returning query execution.

def deduceAssignmentsFromCaseClass(insertee: CaseClass): List[Assignment]
def deduceAssignmentsFromIdent(insertee: Ident): List[Assignment]

Actually the same as deduceAssignmentsFromCaseClass, but I decided to write a separate function and comment it extensively since the logic is not simple to extrapolate. This function creates a series of assignments of a elaborated product. However, each assignment just assigns to the identifier which will be plugged in (i.e. BetaReduced) once the Ident is actually substituted. E.g. if we have something like this: val ip = quote { (p: Person) => query[Person].insertValue(p) } and then later: run(ip(lift(Person("Joe",123)))) then the assignments list is just based on the p identifier of the ip quoted function i.e: (v:Person) => v.firstName -> p.firstName this is achived by doing BetaReduce(v.firstName, v -> p). Later on when ip(lift(Person("Joe",123))) happens the CaseClass(firstName -> lift(...), age -> lift(...)) comes in and all the right values are plugged in correctly.

Actually the same as deduceAssignmentsFromCaseClass, but I decided to write a separate function and comment it extensively since the logic is not simple to extrapolate. This function creates a series of assignments of a elaborated product. However, each assignment just assigns to the identifier which will be plugged in (i.e. BetaReduced) once the Ident is actually substituted. E.g. if we have something like this: val ip = quote { (p: Person) => query[Person].insertValue(p) } and then later: run(ip(lift(Person("Joe",123)))) then the assignments list is just based on the p identifier of the ip quoted function i.e: (v:Person) => v.firstName -> p.firstName this is achived by doing BetaReduce(v.firstName, v -> p). Later on when ip(lift(Person("Joe",123))) happens the CaseClass(firstName -> lift(...), age -> lift(...)) comes in and all the right values are plugged in correctly.

def parseInsertee(insertee: Expr[Any]): CaseClass | Ident

Inserted object can either be static: query[Person]insertValue(Person("Joe", "Bloggs")) or it can be lifted: query[Person].insertValue(lift(Person("Joe", "Bloggs")))

Inserted object can either be static: query[Person]insertValue(Person("Joe", "Bloggs")) or it can be lifted: query[Person].insertValue(lift(Person("Joe", "Bloggs")))

In the later case, it will become: {{ //Assuming x := Person("Joe", "Bloggs") CaseClassLift( Quoted(ast: CaseClass(name -> lift(idA)), ...), lifts: List(EagerLift(x.name, idA), ...)) ) }}

For batch queries liftQuery(people).foreach(p => query[Person].insertValue(p)) it will be just the ast Ident("p")

def parseStaticInsertee(insertee: Expr[_]): CaseClass | Ident

Parse the input to of query[Person]insertValue(Person("Joe", "Bloggs")) into CaseClass(firstName="Joe",lastName="Bloggs")

Parse the input to of query[Person]insertValue(Person("Joe", "Bloggs")) into CaseClass(firstName="Joe",lastName="Bloggs")

def processAssignmentsAndExclusions(assignmentsOfEntity: List[Assignment]): AssignmentList

Get assignments from an entity and then either exclude or include them either statically or dynamically.

Get assignments from an entity and then either exclude or include them either statically or dynamically.

Inherited methods

override
def existsEncoderFor(using Quotes)(tpe: TypeRepr): Boolean
Definition Classes
Inherited from
QuatMaking

Concrete fields