Skip to content

Commit be8021f

Browse files
committed
Another fix
1 parent c3fc0c1 commit be8021f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

quill-core/src/main/scala/io/getquill/context/ActionMacro.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ActionMacro(val c: MacroContext) extends ContextMacro with ReifyLiftings {
5353
(expanded.string, expanded.prepare, expanded.liftings)
5454
}.groupBy(_._1).map {
5555
case (string, items) =>
56-
${c.prefix}.BatchGroup(string, items.map(_._2).toList)
56+
${c.prefix}.BatchGroup(string, items.map(_._2).toList, items.map(_._3).toList)
5757
}.toList,
5858
$options
5959
)(io.getquill.context.ExecutionInfo.unknown, ())
@@ -142,11 +142,11 @@ class ActionMacro(val c: MacroContext) extends ContextMacro with ReifyLiftings {
142142
} else {
143143
$batch.toList.map(element => List(element))
144144
}
145-
/* batchesSharded: List[(String, (Row, MirrorSession) => (List[Any], Row) <a.k.a: prepare>)] */
145+
/* batchesSharded: List[(String, (Row, MirrorSession) => (List[Any], Row <a.k.a: prepare>), List[ScalarLift]) ] */
146146
val batchesSharded = batches.map { subBatch => {
147147
/* `expanded` is io.getquill.context.ExpandWithInjectables(ast, subBatch, injectableLiftList) */
148148
val expanded = $expanded
149-
(expanded.string, expanded.prepare)
149+
(expanded.string, expanded.prepare, expanded.liftings)
150150
}
151151
}
152152
/*
@@ -162,8 +162,8 @@ class ActionMacro(val c: MacroContext) extends ContextMacro with ReifyLiftings {
162162
(INSERT ... VALUES (? ?), List(caboose))
163163
*/
164164
batchesSharded.groupByOrdered(_._1).map {
165-
case (string, items) =>
166-
${c.prefix}.BatchGroup(string, items.map(_._2).toList)
165+
case (string, items, liftings) =>
166+
${c.prefix}.BatchGroup(string, items.map(_._2).toList, items.map(_._3).toList)
167167
}.toList
168168
})(io.getquill.context.ExecutionInfo.unknown, ())
169169
"""
@@ -194,12 +194,12 @@ class ActionMacro(val c: MacroContext) extends ContextMacro with ReifyLiftings {
194194
val batchesSharded = batches.map { subBatch => {
195195
/* `expanded` is io.getquill.context.ExpandWithInjectables(ast, subBatch, injectableLiftList) */
196196
val expanded = $expanded
197-
((expanded.string, $returningColumn), expanded.prepare)
197+
((expanded.string, $returningColumn), expanded.prepare, expanded.liftings)
198198
}
199199
}
200200
batchesSharded.groupByOrdered(_._1).map {
201201
case ((string, column), items) =>
202-
${c.prefix}.BatchGroupReturning(string, column, items.map(_._2).toList)
202+
${c.prefix}.BatchGroupReturning(string, column, items.map(_._2).toList, items.map(_._3).toList)
203203
}.toList
204204
}, ${returningExtractor[T]})(io.getquill.context.ExecutionInfo.unknown, ())
205205
"""

quill-engine/src/main/scala/io/getquill/context/RowContext.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trait RowContext {
1111
private val _identityExtractor: Extractor[Any] = (rr: ResultRow, _: Session) => rr
1212
protected def identityExtractor[T]: Extractor[T] = _identityExtractor.asInstanceOf[Extractor[T]]
1313

14-
case class BatchGroup(string: String, prepare: List[Prepare], liftings: List[ScalarLift])
14+
case class BatchGroup(string: String, prepare: List[Prepare], liftings: List[List[ScalarLift]])
1515
case class BatchGroupReturning(string: String, returningBehavior: ReturnAction, prepare: List[Prepare])
1616

1717
type Prepare = (PrepareRow, Session) => (List[Any], PrepareRow)

0 commit comments

Comments
 (0)