egg-qingger-typeorm
TypeScript icon, indicating that this package has built-in type declarations

2.0.8 • Public • Published

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

Package Sidebar

Install

npm i egg-qingger-typeorm

Weekly Downloads

0

Version

2.0.8

License

MIT

Unpacked Size

44.7 kB

Total Files

46

Last publish

Collaborators

  • shipfi