mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
CountableRange.contains(): turn 0..<10.contains(x) to "x >= 0 AND x < 10" instead of "x BETWEEN 0 AND 9" (and avoid Int ranges to mess with double values)
This commit is contained in:
1 parent
9ae2de6dc1
commit
c4dfd24782
1 file changed
+1
-1
@@ -528,7 +528,7 @@ extension CountableRange where Bound: SQLExpressible {
|
||||
/// // id BETWEEN 1 AND 9
|
||||
/// (1..<10).contains(Column("id"))
|
||||
public func contains(_ element: SQLSpecificExpressible) -> SQLExpression {
|
||||
return SQLExpressionBetween(element.sqlExpression, lowerBound.sqlExpression, upperBound.advanced(by: -1).sqlExpression)
|
||||
return (element >= lowerBound) && (element < upperBound)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user