包含 GreaterThanEqual (gte) 或 lessThanEqual (lte) 的 Squeryl 查询给出错误/无结果
我正在尝试使用 squeryl 进行简单的查询。然而它不起作用!代码编译但查询没有返回结果,但它应该!空白 SQL 中的相同查询可以完美运行。 SELECT * FROM tablename WHERE 位置 <= 83172924
val qryResult = from(DBName.tablename)(t => where(t.position === 83172924) select (t)) //works! but not what i want
val qryResult = from(DBName.tablename)(t => where(t.position <= 83172924) select (t)) //compile OK, no results
val qryResult = from(DBName.tablename)(t => where(t.position lte 83172924) select (t)) //compile ERROR
object DBName extends Schema {
val tablename = table[FOO]("tablename")
}
class FOO(var position: Int) {
def this() = this (0)
}
根据 http: //max-l.github.com/Squeryl/functions.html 它应该可以工作吗?!
任何帮助表示赞赏。
I'm trying to do a simple query with squeryl. however it doesn't work! the code compiles but the query returns no results, but it should! the same query in blank SQL works perfectly. SELECT * FROM tablename WHERE position <= 83172924
val qryResult = from(DBName.tablename)(t => where(t.position === 83172924) select (t)) //works! but not what i want
val qryResult = from(DBName.tablename)(t => where(t.position <= 83172924) select (t)) //compile OK, no results
val qryResult = from(DBName.tablename)(t => where(t.position lte 83172924) select (t)) //compile ERROR
object DBName extends Schema {
val tablename = table[FOO]("tablename")
}
class FOO(var position: Int) {
def this() = this (0)
}
according to http://max-l.github.com/Squeryl/functions.html it should work?!
any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该会给您一个弃用警告:
有一个已弃用的隐式转换会导致问题,请参阅此
https://groups.google.com/forum/#!searchin/squeryl/implicit$20boolean/squeryl/pSUzNDA4Bq4/oHmqS16yD_0J
我刚刚将其从主分支中删除。
这个应该可以工作:
我刚刚尝试过,它可以正确编译并运行。
This should have given you a deprecation warning :
There's a deprecated implicit conversion that is causing trouble, see this
https://groups.google.com/forum/#!searchin/squeryl/implicit$20boolean/squeryl/pSUzNDA4Bq4/oHmqS16yD_0J
I just removed it from master branch.
This one should work :
I just tried it and it compiles and runs correctly.