- Notifications
You must be signed in to change notification settings - Fork 737
feat: add sequelize example #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @iyuq, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fengmk2 and @dead-horse to be potential reviewers. |
sequelize-example/README.md Outdated
| see [egg docs][egg] for more detail. | ||
| | ||
| ### Unittest | ||
| ```shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bash
sequelize-example/README.md Outdated
| | ||
| ### Unittest | ||
| ```shell | ||
| $ createdb example-unittest --owner postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add to test/.setup.js ? like https://github.com/eggjs/egg-mysql/blob/master/test/.setup.js
| @@ -0,0 +1,23 @@ | |||
| 'use strict'; | |||
| | |||
| module.exports = () => { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件不需要了吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在egg是不是默认就使用了onerror的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
内置一直都有 egg-onerror
| 可以合了吗 |
sequelize-example/README.zh-CN.md Outdated
| [![build][build]][build-url] | ||
| [![coverage][cover]][cover-url] | ||
| | ||
| 使用egg-sequelize插件的egg示例项目。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中英文混排,前后加空格 使用 egg-sequelize 插件的 egg 示例项目。
sequelize-example/README.md Outdated
| [![build][build]][build-url] | ||
| [![coverage][cover]][cover-url] | ||
| | ||
| The egg example project that uses egg-sequelize plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加下 egg-sequelize 的链接, [egg-sequelize](http://....)
| return class UserController extends app.Controller { | ||
| * posts() { | ||
| this.ctx.body = yield this.service.post.list(this.ctx.query); | ||
| * posts(ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class 模式下,还是用 this.ctx 好点。
* posts() { const ctx = this.ctx; }| @atian25 改完了,再看看 |
sequelize-example/README.md Outdated
| # sequelize-example | ||
| | ||
| The egg example project that uses egg-sequelize plugin. | ||
| The [egg][egg] example project that uses [egg-sequelize][egg-sequelize] plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同名情况下,[egg][egg] 可以简写为 [egg] 的
| +1 , ci 过就合并 |
| ref: eggjs/egg#1026 |
@atian25 @jtyjty99999 sequelize-example已加。