2.0.8 • Published 4 years ago

egg-qingger-typeorm v2.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

egg-qingger-typeorm

NPM version build status Test coverage David deps [Known Vulnerabilities][snyk-url npm download

Install

$ npm i egg-qingger-typeorm --save

Usage

// {app_root}/config/plugin.js
exports.qinggerTypeorm = {
  enable: true,
  package: 'egg-qingger-typeorm',
};

Configuration

// {app_root}/config/config.default.js
// see detail : http://typeorm.io/#/connection-options
exports.qinggerTypeorm = {
   "type": "mysql",
   "host": "localhost",
   "port": 3306,
   "username": "test",
   "password": "test",
   "database": "test",
   "synchronize": true,
   "logging": false,
   "entities": [
      "src/entity/**/*.ts"
   ],
   "migrations": [
      "src/migration/**/*.ts"
   ],
   "subscribers": [
      "src/subscriber/**/*.ts"
   ]
};

see config/config.default.js for more detail.

Example

    // @see detail : http://typeorm.io/
    // save object
    const photo = new Photo();
    photo.name = 'P1';
    photo.fileName = 'p1.png';
    photo.isPublished = true;
    photo.views = 0;
    let ret = await this.app.qinggerTypeorm.manager.save(photo);
    

Questions & Suggestions

Please open an issue here.

Update

注意,不使用dist目录下编译的文件
$ tsc
$ git add . / git commit
$ npm config set registry https://registry.npmjs.org/
$ npm login  
$ npm whoami
$ npm version patch / minor / major
$ npm publish
$ npm logout
$ git push

License

MIT

2.0.6

4 years ago

2.0.8

4 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago