-
Notifications
You must be signed in to change notification settings - Fork 71
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
add range condition #24
base: master
Are you sure you want to change the base?
Conversation
@@ -183,14 +183,15 @@ let rows = yield db.select('table-name'); | |||
```js | |||
let rows = yield db.select('table-name', { | |||
where: { | |||
type: 'javascript' | |||
type: 'javascript', | |||
date: [{ op: '>=', value: '20170504'}] |
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.
date: { op: '>=', value: '20170504'}
这样会更好吧,可以参考一下业务关于 where 的 api 实现。
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.
@dead-horse @coolme200 对于 api 有什么好建议吗?
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.
date >= 100 AND date <= 200
这种需求么?
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.
最好也支持只传一个 object 的场景吧 date: { op: '>=', value: '20170504'}
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
=========================================
Coverage ? 97.53%
=========================================
Files ? 6
Lines ? 284
Branches ? 41
=========================================
Hits ? 277
Misses ? 7
Partials ? 0
Continue to review full report at Codecov.
|
OR 的功能估计也需要考虑一下 eggjs/egg#1035 |
几个月过去了,这个 PR 还有下文吗 |
这个PR还有下文吗? |
还有LIKE的场景,能不能支持~ @fengmk2
|
Any updates? |
哟,or会有吗?需要的老哥们,咱们组队贡献代码吧!? |
定制 where 查询条件时,研究了下源代码,发现仅支持
=
和IN
操作,本人项目开发到一半,发现不能满足需求,故扩展了 where 对象的能力,更加灵活可控。