Gorm: eager DB reverse tools

Created on 4 Nov 2013  ·  2Comments  ·  Source: go-gorm/gorm

对于已经存在的数据库, 编写所有model是件费力费时的工作, 如果能够批量生成struct定义会带来极大方便, 例如

gorm dump  mysql://root:123@databasename 

Go毕竟是一门新语言, 从头开始构建一个生产系统的机会不多, 在旧系统周边用起来的机会比较多, 保持对外界的灵活性能增加生命力.

Most helpful comment

Here is a tool to do this. https://github.com/asdf072/struct-create

All 2 comments

嗯,看起来不错的功能,但我感觉最好的作为第三方的工具存在,而不是集成在gorm里。

因为这个功能的使用频率应该不高,一年可能也就使用一次.

另一个更重要的原因是,如果做这个需要在gorm里集成 mysql, postgres, sqlite 的驱动, 对于很多有代码洁癖的人都感觉很别扭。。。

所以有一个第三方库的话,应该还是挺好的。

Here is a tool to do this. https://github.com/asdf072/struct-create

Was this page helpful?
0 / 5 - 0 ratings

Related issues

koalacxr picture koalacxr  ·  3Comments

izouxv picture izouxv  ·  3Comments

bramp picture bramp  ·  3Comments

sredxny picture sredxny  ·  3Comments

Quentin-M picture Quentin-M  ·  3Comments