Slick 3.1 - Printing SQL from DBIOAction (insert statements)

余生长醉 提交于 2019-12-23 06:56:11

问题


In Slick 3.1, with the complete redesign of the new API, it seems to be impossible to view the generated SQL statements when doing an insert.

If you have something like this

val action = DBIO.seq(
  SomeTables ++= Seq(TableData(1,"First"),TableData(2,"Second"))
)

It doesn't seem you are actually able to see the generated SQL from the action. The result method doesn't actually exist, and variations of statements just print ? in place of the actual values if you don't use DBIO.seq, if you are using DBIO.seq the statements method doesn't actually exist.

Even when using methods such as .transactionally or .withPinnedSession, it doesn't seem to make a difference (however I don't know how this should help).

From observation of all of the methods, it appears that this is impossible?

来源:https://stackoverflow.com/questions/33124899/slick-3-1-printing-sql-from-dbioaction-insert-statements

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!