sequelize v4 支持 ctx 的模式
Open
Inactive
plugin: egg-mysql
- Dominant language
- TypeScript
- Stars
- 19k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
fork 了一个版本,基于 v4 实现 ctx class 模式,方便让 sql 请求与 http ctx 上下文发生关联。
https://github.com/eggjs/sequelize/tree/v3
## 需要实现的功能
- [ ] 基于 ctx 的 model => ContextModel 和 ContextSequelize,自动传递 ctx 上下文
- [ ] ctx 在 sequelize 内部是通过 model, instance 或者 options 参数自动传递
- [ ] 提供 `beforeQuery` 和 `afterQuery` hooks,让日志打印可以个性化
- [ ] mysql 使用 mysql 模块自身的 pool 实现
## 依赖的 PRs
- https://github.com/eggjs/sequelize/pull/1
- https://github.com/eggjs/egg-sequelize/pull/36
Contributor guide
Assessment
This issue has not been assessed yet.