首页 > 其他分享 >EGG配合利用EGG-SEQUELIZE-AUTO反生MODEL

EGG配合利用EGG-SEQUELIZE-AUTO反生MODEL

时间:2023-01-05 18:55:05浏览次数:45  
标签:tables database -- AUTO models 反生 EGG sequelize

1.全局安装EGG-SEQUELIZE-AUTO模块

cnpm install -g egg-sequelize-auto

 

2.全局安装MYSQL2模块

cnpm install -g mysql2

1

3.创建MODEL

egg-sequelize-auto -o "./models" -d shop -h localhost -u root -p 3306 -x 1234 -e mysql
[node] egg-sequelize-auto -h <host> -d <database> -u <user> -x [password] -p [port]  --dialect [dialect] -c [/path/to/config] -o [/path/to/models] -t [tableName] -C

Options:
  -h, --host        IP/Hostname for the database.   [required]
  -d, --database    Database name.                  [required]
  -u, --user        Username for database.
  -x, --pass        Password for database.
  -p, --port        Port number for database.
  -c, --config      JSON file for Sequelize's constructor "options" flag object as defined here: https://sequelize.readthedocs.org/en/latest/api/sequelize/
  -o, --output      What directory to place the models.
  -e, --dialect     The dialect/engine that you're using: postgres, mysql, sqlite
  -a, --additional  Path to a json file containing model definitions (for all tables) which are to be defined within a model's configuration parameter. For more info: https://sequelize.readthedocs.org/en/latest/docs/models-definition/#configuration
  -t, --tables      Comma-separated names of tables to import
  -T, --skip-tables Comma-separated names of tables to skip
  -C, --camel       Use camel case to name models and fields
  -n, --no-write    Prevent writing the models to disk.
  -s, --schema      Database schema from which to retrieve tables
  -z, --typescript  Output models as typescript with a definitions file.
 

标签:tables,database,--,AUTO,models,反生,EGG,sequelize
From: https://www.cnblogs.com/luoguixin/p/17028627.html

相关文章

  • 提示错误:Could not autowire. No beans of ‘Person‘ type found.
     SpringBoot的启动类要放到根目录下,刚开始建项目的时候,IDEA自动把启动类放到了main/java/com.xxx.项目名这个包下如图: ......
  • pyautogui + opencv 笔记
    安装pipinstallpyautoguipipinstallopencv-python==3.4.8.291,控制鼠标的移动获取屏幕分辨率>>>importpyautogui>>>宽,高=pyautogui.size()>>>宽,高......
  • mysql 中的auto_increment自增值
    1.初始化自增值默认值是从1开始,在建表时使用“AUTO_INCREMENT=n”可以来指定一个自增的初始值,比如:CREATETABLEtest(idINTUNSIGNEDNOTNULLPRIMARYKEYAUTO_INCR......
  • 变分自编码器 - VAE: Variational Auto-Encoder
    总之,VAE本身是一个生成模型,我们假设观测的某个变量\(\mathbf{x}\)(比如数字0~9的各种图像)受到隐变量\(\mathbf{z}\)的影响,那么在得到分布后,只需要采样得到一个\(\mat......
  • AutoCloseable
    转载自https://blog.csdn.net/WU4566285/article/details/1151011281、AutoCloseable接口的介绍从AutoCloseable的注释可知它的出现是为了更好的管理资源,准确说是资源的释......
  • 关闭Mac的Microsoft AutoUpdate弹框提示
    macOS安装MicrosoftOfficeforMac之后,有时候会弹出MicrosoftAutoUpdate微软应用自动更新工具。就像下面这样:(我不知道您会不会烦,我是烦了)如果您也和我一样,不喜欢这样不......
  • egg-validate 效验实现中文提示配置
    在使用egg.js进行后台接口开发过程中,对参数的效验是必不可少,这里就用到了egg-validate这个插件,由于egg-validate是默认使用英文进行提示,所以对前端提示不是特别友好,所以我......
  • svg pointer-events="auto"
    svg  pointer-events="auto" <svgwidth="640"height="480"version="1.1"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"poi......
  • 免费又好用的财务机器人来了!----我为什么推荐Power Automate Desktop平台
       有30多年会计信息化教学和实践经验的我,从2017年德勤财务机器人一问世就密切关注着这个领域的发展,一直在比较各种RPA(机器人流程自动化)平台的性能与价格,并于2020年在......
  • AutoCAD Civil3D 2023安装图文教程
    ​Civil3D2023简单介绍Civil3D设计软件是土木工程师的首选软件,也是民用大众领域的综合解决方案,同时Civil3D提供了AutoCAD和AutoCADMap3D的功能,该软件使用基于模型的......