jecshcier
V2EX  ›  Node.js

有没有用 Sequlize 的小伙伴?

  •  
  •   jecshcier · Jan 2, 2018 via iPhone · 4296 views
    This topic created in 3065 days ago, the information mentioned may be changed or developed.

    不知道对于已有的数据库表格,各位是如何导出模型的呢?一直以来用 git 上的一个插件,但觉得一般,官方有这样的工具吗?像 mybatis 这样可以一键生成模型的

    3 replies    2018-01-04 11:41:30 +08:00
    dotnil
        1
    dotnil  
       Jan 2, 2018
    写个脚本从 information_schema.columns 查一份 format 一下?
    yst93
        2
    yst93  
       Jan 3, 2018
    你可以用这个: https://github.com/sequelize/sequelize-auto
    我的一个项目就是用这个将数据库表格导出到 js 文件的。
    jecshcier
        3
    jecshcier  
    OP
       Jan 4, 2018 via iPhone
    @yst93 感谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   944 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:48 · PVG 04:48 · LAX 13:48 · JFK 16:48
    ♥ Do have faith in what you're doing.