首页 > 数据库 >typeorm-model-generator 数据库映射Model 命令 - nest

typeorm-model-generator 数据库映射Model 命令 - nest

时间:2022-10-12 23:37:37浏览次数:72  
标签:generator nest 数据库 https Model com model typeorm

typeorm-model-generator 数据库映射Model 命令

NestJs中的控制器、路由、Get、Post方法参数装饰器

Nest.js 从零到壹系列(二):使用 Sequelize 操作数据库

这里说 不要用 typeorm-model-generator 数据库映射 我觉得说的没错,直接用原生Sql

生成资源

nest generate --help
nest g res todoList api

不创建 spec

nest g --no-spec res todoList api
或者在 nest-cli.json

{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"generateOptions": {
"spec": false
}
}

全局路由前缀

app.setGlobalPrefix('api'); // 全局路由前缀
http://localhost:3000/api/todo-list/getUser

Nest.js 从零到壹系列(一):项目创建&路由设置&模块

NestJS 官方文档-中文
​​​https://nestjs.bootcss.com/​

TypeORM 中文文档
​​​https://typeorm.biunav.com/zh/​

TypeORM中更新数据库的坑

​https://www.npmjs.com/package/typeorm-model-generator​

nestjs中使用typeorm-model-generator将数据库生成数据模型
​​​https://blog.51cto.com/u_3409716/2904414​

---------------------------------------------
生活的意义并不是与他人争高下,而在于享受努力实现目标的过程,结果是对自己行动的嘉奖。
↑面的话,越看越不痛快,应该这么说:

生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!

新博客 ​​​https://www.VuejsDev.com​​ 用于梳理知识点



标签:generator,nest,数据库,https,Model,com,model,typeorm
From: https://blog.51cto.com/u_15770151/5751851

相关文章