0.0.5 • Published 5 years ago
@moonboot/plugin-mysql v0.0.5
@moonboot/plugin-mysql
What
A Project support mysql2 for
moon-boot
How to use
npm i @moonboot/plugin-mysqlThen you can use mysql with
MysqlTemplateas 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-mysqlDecorator
FAQ
Param
redis.cluster = falseuseCluster or not, default isfalseredis...The config underrediswill pass tonew IoRedis() / new IoRedis.Cluster()