Scala Slick Database Views

筅森魡賤 提交于 2019-12-11 02:53:47

问题


Is there any way to use slick with database views? When I run the standard code generator, nothing about views are listed. I also can't seem to find anything in the documentation mentioning the ability (or lack thereof) to do so.


回答1:


Yes it is perfectly possible to use views, but you need to tweak code generation a tiny bit. See here for more specific information: https://github.com/slick/slick/issues/1022 (comment of "mobiworx")




回答2:


If you follow the link provided by tfh, the following code snippet worked for me:

slick.jdbc.meta.MTable.getTables(None, None, None, Some(Seq("VIEW","TABLE")))


来源:https://stackoverflow.com/questions/28077228/scala-slick-database-views

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