Scala Slick:MTable.getTables返回空的向量/列表 [英] Scala Slick: MTable.getTables return empty vector/list

查看:95
本文介绍了Scala Slick:MTable.getTables返回空的向量/列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Slick在DML查询中返回结果,在执行表创建操作时引发异常,但是MTable.getTables返回空向量/列表.我正在使用MySQL作为SQL解决方案.

Slick is returning result in DML queries, throwing exceptions while executing table creation actions, but the MTable.getTables return empty vector/list. I am using MySQL as SQL solution.

  println(Await.result(db.run(MTable.getTables), Duration.Inf))

在控制台中打印Vector().

推荐答案

在我的第一种情况下,问题是无效的表结构.

The problem in my first case was invalid table structure.

第二种情况下的问题是无效的写权限.

The problem in my second case was invalid write permissions.

如何知道查询失败背后的确切问题:

How to know the exact problem behind query failure:

执行此操作:

  val tables = List(Emails.emails)
  val setup = DBIO.sequence(
    tables.map(_.schema.create.asTry)
  )

  Await.result(db.run(setup).map(a => {
    println("/****\n\n\n\n\n\n\n\n\n\n\n\n\n")
    println(a)
    println("\n\n\n\n\n\n\n\n\n\n\n\n\n*************/")
  }), Duration.Inf)

这篇关于Scala Slick:MTable.getTables返回空的向量/列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆