我可以自动生成Squeryl数据对象以反映现有的MySql模式吗? [英] Can I auto generate Squeryl data objects to reflect an existing MySql schema?

查看:84
本文介绍了我可以自动生成Squeryl数据对象以反映现有的MySql模式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MySql数据库中有一个现有的架构定义.我使用MySql Workbench创建了架构.

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

我希望从我的Lift-Scala-Squeryl代码访问架构.我知道一种简单的方法是使用Squeryl数据对象手动定义架构结构.

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.

是否有一种自动方法可以从现有的MySql模式中生成Squeryl数据对象?

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.

谢谢大卫.

推荐答案

Squeryl的创建者Max建议,这是一个好主意. 这是Google网上论坛的讨论.

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

您可能对此不太满意,但是我认为我不喜欢他:)因此,据我所知,没有办法做到这一点.除了我在该线程中指出的问题之外,Squeryl可以在多种模式下工作(原始类型,自定义类型,提升记录类型)这一事实将是一件困难的事情,而且每个人都适合.

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.

这篇关于我可以自动生成Squeryl数据对象以反映现有的MySql模式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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