jecshcier
V2EX  ›  Node.js

有没有用 Sequlize 的小伙伴?

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

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

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