播种的类型::seedling:一种将测试数据播种到数据库中的令人愉快的方法

时间:2021-01-30 19:40:46
【文件属性】:
文件名称:播种的类型::seedling:一种将测试数据播种到数据库中的令人愉快的方法
文件大小:189KB
文件格式:ZIP
更新时间:2021-01-30 19:40:46
cli typescript database seed seeding TypeORM播种 一种将测试数据植入数据库的令人愉悦的方式。 受到PHP中令人敬畏的框架存储库的用 :red_heart_selector: 由和 ❯ 目录 ❯ 介绍 为您的数据库创建一些示例数据不是很累,但是这次结束了! 它是如何工作的? 只需为您的实体(模型)和种子脚本创建一个实体工厂。 实体 首先创建您的TypeORM实体。 // user.entity.ts @ Entity ( ) export class User { @ PrimaryGeneratedColumn ( 'uuid' ) id : string @ Column ( { nullable : true } ) name : string @ Column ( { type : 'varchar' , length : 100 , nullable : false } ) password : string @ OneToMany ( ( type ) => Pet , ( pet ) => pet . user ) pets : Pet [ ] @ BeforeInsert (
【文件预览】:
typeorm-seeding-master
----.gitignore(299B)
----sample()
--------entities()
--------factories()
--------seeds()
--------test()
----package.json(2KB)
----.sgcrc(29B)
----src()
--------cli.ts(395B)
--------json.d.ts(70B)
--------helpers.test.ts(262B)
--------importer.ts(301B)
--------utils()
--------entity-factory.ts(5KB)
--------commands()
--------connection.ts(3KB)
--------helpers.ts(290B)
--------types.ts(1KB)
--------typeorm-seeding.ts(3KB)
--------entity-factory.test.ts(2KB)
----.travis.yml(511B)
----jest.config.js(69B)
----LICENSE(1KB)
----tsconfig.json(406B)
----.eslintrc.js(750B)
----README.md(13KB)
----logo.png(37KB)
----tsconfig.build.json(99B)
----.npmignore(138B)
----.releaserc(376B)
----.editorconfig(298B)
----.prettierrc(137B)
----ormconfig.js(512B)
----yarn.lock(324KB)

网友评论