@moonboot/plugin-mysql
v0.0.5
Published
> A Project support [mysql2](https://www.npmjs.com/package/mysql2) for `moon-boot`
Downloads
7
Readme
@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
redis.cluster = false
useCluster or not, default isfalse
redis...
The config underredis
will pass tonew IoRedis() / new IoRedis.Cluster()