0

在 mariadb 10.5.9 和 scala 2.13 上使用MysqlMonixJdbcContextgetquill.io 并尝试使用

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`);

我收到以下错误

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

我该如何解决这个问题?

4

0 回答 0