0.0.5 • Published 4 years ago

@moonboot/plugin-mysql v0.0.5

Weekly downloads
127
License
MIT
Repository
-
Last release
4 years ago

@moonboot/plugin-mysql

What

A Project support mysql2 for moon-boot

How to use

npm i @moonboot/plugin-mysql

Then you can use mysql with MysqlTemplate as the following example.

// This Moudle will auto use when installed
// See project For More Information
// index.ts
import { start } from 'moon-boot'
class Main {
  constructor() {
    start(__dirname)
  }
}
new Main()
// service.ts
@Bean()
class TestService {
  @Autowired()
  mysqlTemplate!: MysqlTemplate

  test() {
    this.mysqlTemplate.query('select 1 from dual')
  }
}

With npx

$ npx create-moon-boot use plguin-mysql

Decorator

FAQ

Param

  1. redis.cluster = false useCluster or not, default is false
  2. redis... The config under redis will pass to new IoRedis() / new IoRedis.Cluster()
0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago