Pipeline

io.getquill.context.InsertUpdateMacro.Pipeline
class Pipeline[T, A <: ([T] =>> Insert[T] | Update[T])](isStatic: Boolean)(implicit evidence$1: Type[T], evidence$2: Type[A], x$2: Quotes) extends QuatMaking, 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.

Attributes

Graph
Supertypes
trait QuatMaking
class Object
trait Matchable
class Any

Members list

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?

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
case Static

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class InserteeSchema(schemaRaw: Expr[EntityQuery[T]])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum MacroType

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object MacroType

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
MacroType.type

Inherited classlikes

object InferQuat

Attributes

Inherited from:
QuatMakingBase
Supertypes
class Object
trait Matchable
class Any

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.

Attributes

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.

Attributes

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.

Attributes

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")

Attributes

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")

Attributes

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.

Attributes

Inherited methods

Attributes

Inherited from:
QuatMakingBase
override def existsEncoderFor(using Quotes)(tpe: TypeRepr): Boolean

Attributes

Definition Classes
Inherited from:
QuatMaking

Concrete fields

Givens

Givens

given given_TranspileConfig: TranspileConfig