Can I auto generate Squeryl data objects to reflect an existing MySql schema?

谁都会走 提交于 2019-12-22 09:48:43

问题


I have an existing Schema definition in MySql database. I created the schema using MySql Workbench.

I wish to access the schema from my Lift-Scala-Squeryl code. I know that a simple way would be to manually define the schema structure using Squeryl data objects.

Is there an automated way to generate Squeryl data objects out of existing MySql schema?

I've found the following general question, but I'm sure there can be a way to generate a naive structure, although not accurate, it will allow a better starting point for the manual work.

Thanks, David.


回答1:


Max, Squeryl's creator, had suggested that this would be a good idea a while back. Here is the google group discussion.

You may not be too pleased with me for this, but I think I talked him out of it :) So, to my knowledge, there isn't a way to do it. Besides the issues I pointed out in that thread, the fact that Squeryl can work in multiple modes (primitive types, custom types, lift record types) it would be a difficult thing to do and get right for everyone.



来源:https://stackoverflow.com/questions/9517327/can-i-auto-generate-squeryl-data-objects-to-reflect-an-existing-mysql-schema

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