diff --git a/.swift-version b/.swift-version index 11b6ddd3..8590c95d 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -DEVELOPMENT-SNAPSHOT-2016-04-12-a +DEVELOPMENT-SNAPSHOT-2016-05-03-a diff --git a/Package.swift b/Package.swift index 35e5dc9b..12cc8295 100644 --- a/Package.swift +++ b/Package.swift @@ -3,13 +3,8 @@ import PackageDescription let package = Package( name: "SQLite.swift", targets: [ - Target( - name: "SQLite", - dependencies: [ - .Target(name: "CSQLite") - ]), - Target( - name: "CSQLite") + Target(name: "SQLite", dependencies: [.Target(name: "CSQLite")]), + Target(name: "CSQLite") ] ) diff --git a/Sources/SQLite/Typed/CoreFunctions.swift b/Sources/SQLite/Typed/CoreFunctions.swift index 48a3b208..822fb4d2 100644 --- a/Sources/SQLite/Typed/CoreFunctions.swift +++ b/Sources/SQLite/Typed/CoreFunctions.swift @@ -357,7 +357,7 @@ extension ExpressionType where UnderlyingType == String { } public subscript(range: Range) -> Expression { - return substring(range.startIndex, length: range.endIndex - range.startIndex) + return substring(range.lowerBound, length: range.upperBound - range.lowerBound) } } @@ -581,12 +581,12 @@ extension ExpressionType where UnderlyingType == String? { /// /// - Returns: A copy of the expression wrapped with the `substr` function. public subscript(range: Range) -> Expression { - return substring(range.startIndex, length: range.endIndex - range.startIndex) + return substring(range.lowerBound, length: range.upperBound - range.lowerBound) } } -extension Collection where Iterator.Element : Value, Index.Distance == Int { +extension Collection where Iterator.Element : Value, IndexDistance == Int { /// Builds a copy of the expression prepended with an `IN` check against the /// collection. diff --git a/Sources/SQLite/Typed/Operators.swift b/Sources/SQLite/Typed/Operators.swift index 790a17c5..9793b3e3 100644 --- a/Sources/SQLite/Typed/Operators.swift +++ b/Sources/SQLite/Typed/Operators.swift @@ -473,13 +473,13 @@ public func <=(lhs: V, rhs: Expression< public func <=(lhs: V, rhs: Expression) -> Expression { return infix(lhs, rhs) } - -public func ~=, V.Datatype == I.Bound>(lhs: I, rhs: Expression) -> Expression { - return Expression("\(rhs.template) BETWEEN ? AND ?", rhs.bindings + [lhs.start, lhs.end]) -} -public func ~=, V.Datatype == I.Bound>(lhs: I, rhs: Expression) -> Expression { - return Expression("\(rhs.template) BETWEEN ? AND ?", rhs.bindings + [lhs.start, lhs.end]) -} +// +//public func ~=, V.Datatype == I.Bound>(lhs: I, rhs: Expression) -> Expression { +// return Expression("\(rhs.template) BETWEEN ? AND ?", rhs.bindings + [lhs.start, lhs.end]) +//} +//public func ~=, V.Datatype == I.Bound>(lhs: I, rhs: Expression) -> Expression { +// return Expression("\(rhs.template) BETWEEN ? AND ?", rhs.bindings + [lhs.start, lhs.end]) +//} // MARK: - diff --git a/Tests/SQLite/OperatorsTests.swift b/Tests/SQLite/OperatorsTests.swift index 86aa34ed..8da90a04 100644 --- a/Tests/SQLite/OperatorsTests.swift +++ b/Tests/SQLite/OperatorsTests.swift @@ -245,10 +245,10 @@ class OperatorsTests : XCTestCase { AssertSQL("(1 <= \"boolOptional\")", true <= boolOptional) } - func test_patternMatchingOperator_withComparableInterval_buildsBetweenBooleanExpression() { - AssertSQL("\"int\" BETWEEN 0 AND 5", 0...5 ~= int) - AssertSQL("\"intOptional\" BETWEEN 0 AND 5", 0...5 ~= intOptional) - } +// func test_patternMatchingOperator_withComparableInterval_buildsBetweenBooleanExpression() { +// AssertSQL("\"int\" BETWEEN 0 AND 5", 0...5 ~= int) +// AssertSQL("\"intOptional\" BETWEEN 0 AND 5", 0...5 ~= intOptional) +// } func test_doubleAndOperator_withBooleanExpressions_buildsCompoundExpression() { AssertSQL("(\"bool\" AND \"bool\")", bool && bool)