Batch insert is throwing error with Quill.io with mariadb when using Monix

346 Views Asked by At

On mariadb 10.5.9 and scala 2.13 using MysqlMonixJdbcContext from getquill.io and trying to do a batch insert with

import io.getquill._
val ctx = new MysqlMonixJdbcContext(SnakeCase, "ctx")
import ctx._

val images: List[Image] = ...
run(
    liftQuery(images).map(i => query[Image].insert(i).onConflictIgnore)
)
case class Image(path: String, digest: String, size: Int, id: Option[Int])
CREATE TABLE `IMAGE` (
    `path` VARCHAR(500) NOT NULL,
    `digest` VARCHAR(50) NOT NULL,
    `size` INT UNSIGNED NOT NULL,
    `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
    PRIMARY KEY (`id`)
)
COLLATE='utf8mb4_general_ci';

ALTER TABLE `IMAGE`
    ADD UNIQUE INDEX `uk_path` (`path`);

I get the following error

exception during macro expansion:
scala.reflect.macros.TypecheckException: Case class type io.getquill.Insert[Image] has no values

How do I resolve this?

0

There are 0 best solutions below