设置一切正常但在尝试使用 Quill 时出现错误 "Failed to load data source for config"?

Setup everything ok but got error "Failed to load data source for config" while try to use Quill?

我尝试在 IDEA 中使用 quill,设置一切正常:

1 sbt 依赖项:

libraryDependencies ++= Seq(
 "mysql" % "mysql-connector-java" % "8.0.17",
 "io.getquill" %% "quill-jdbc" % "3.7.0"
)

2 application.properties(使用我的参数):

ctx.dataSourceClassName=com.mysql.cj.jdbc.MysqlDataSource
ctx.dataSource.url=jdbc:mysql://host/database
ctx.dataSource.user=root
ctx.dataSource.password=root
ctx.dataSource.cachePrepStmts=true
ctx.dataSource.prepStmtCacheSize=250
ctx.dataSource.prepStmtCacheSqlLimit=2048
ctx.connectionTimeout=30000

我还没有找到文件 application.properties 在 sbt 项目中的位置,但是我已经在项目的每个 floder:the top floder 中复制了它,floder /src,floder /project,所以我认为它会起作用

3 代码(使用mysql“世界”数据库):

import io.getquill._

object A extends App{

 lazy val ctx = new MysqlJdbcContext(SnakeCase, "ctx")
 import ctx._

 case class City(id: Int,name:String,countryCode:String,district:String,population:Int)

 val q = quote {
  query[City].filter(c => c.id > 1)
 }

 ctx.run(q) 
}

但出现错误:

[main] ERROR com.zaxxer.hikari.HikariConfig - HikariPool-1 - dataSource or dataSourceClassName or 
jdbcUrl is required.
Exception in thread "main" java.lang.IllegalStateException: Failed to load data source for config: 
'Config(SimpleConfigObject({}))'
at io.getquill.JdbcContextConfig.dataSource(JdbcContextConfig.scala:25)
at io.getquill.MysqlJdbcContext.<init>(MysqlJdbcContext.scala:14)
at io.getquill.MysqlJdbcContext.<init>(MysqlJdbcContext.scala:15)
at io.getquill.MysqlJdbcContext.<init>(MysqlJdbcContext.scala:16)
at A$.ctx$lzycompute(A.scala:5)
at A$.ctx(A.scala:5)
at A$.delayedEndpoint$A(A.scala:14)
at A$delayedInit$body.apply(A.scala:3)
at scala.Function0.apply$mcV$sp(Function0.scala:34)
at scala.Function0.apply$mcV$sp$(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App.$anonfun$main$adapted(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:388)
at scala.App.main(App.scala:76)
at scala.App.main$(App.scala:74)
at A$.main(A.scala:3)
at A.main(A.scala)
Caused by: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required.
at com.zaxxer.hikari.HikariConfig.validate(HikariConfig.java:1004)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:77)
at io.getquill.JdbcContextConfig.dataSource(JdbcContextConfig.scala:22)
... 16 more

那怎么解决呢?我觉得这个程序找不到 config.Thanks!

将配置属性放入 application.conf 而不是 application.properties