Skip to content

Commit c96a5da

Browse files
committed
fix xcode-10.2 issues
1 parent ed8f603 commit c96a5da

File tree

4 files changed

+147
-159
lines changed

4 files changed

+147
-159
lines changed

Sources/SQLite/Helpers.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,6 @@ extension String {
9898

9999
}
100100

101-
func infix<T>(_ lhs: Expressible, _ rhs: Expressible, wrap: Bool = true, function: String = #function) -> Expression<T> {
102-
return function.infix(lhs, rhs, wrap: wrap)
103-
}
104-
105-
func wrap<T>(_ expression: Expressible, function: String = #function) -> Expression<T> {
106-
return function.wrap(expression)
107-
}
108-
109-
func wrap<T>(_ expressions: [Expressible], function: String = #function) -> Expression<T> {
110-
return function.wrap(", ".join(expressions))
111-
}
112-
113101
func transcode(_ literal: Binding?) -> String {
114102
guard let literal = literal else { return "NULL" }
115103

Sources/SQLite/Typed/AggregateFunctions.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension ExpressionType where UnderlyingType : Value {
4848
/// - Returns: A copy of the expression wrapped with the `count` aggregate
4949
/// function.
5050
public var count: Expression<Int> {
51-
return wrap(self)
51+
return "count".wrap(self)
5252
}
5353

5454
}
@@ -79,7 +79,7 @@ extension ExpressionType where UnderlyingType : _OptionalType, UnderlyingType.Wr
7979
/// - Returns: A copy of the expression wrapped with the `count` aggregate
8080
/// function.
8181
public var count: Expression<Int> {
82-
return wrap(self)
82+
return "count".wrap(self)
8383
}
8484

8585
}
@@ -96,7 +96,7 @@ extension ExpressionType where UnderlyingType : Value, UnderlyingType.Datatype :
9696
/// - Returns: A copy of the expression wrapped with the `max` aggregate
9797
/// function.
9898
public var max: Expression<UnderlyingType?> {
99-
return wrap(self)
99+
return "max".wrap(self)
100100
}
101101

102102
/// Builds a copy of the expression wrapped with the `min` aggregate
@@ -109,7 +109,7 @@ extension ExpressionType where UnderlyingType : Value, UnderlyingType.Datatype :
109109
/// - Returns: A copy of the expression wrapped with the `min` aggregate
110110
/// function.
111111
public var min: Expression<UnderlyingType?> {
112-
return wrap(self)
112+
return "min".wrap(self)
113113
}
114114

115115
}
@@ -126,7 +126,7 @@ extension ExpressionType where UnderlyingType : _OptionalType, UnderlyingType.Wr
126126
/// - Returns: A copy of the expression wrapped with the `max` aggregate
127127
/// function.
128128
public var max: Expression<UnderlyingType> {
129-
return wrap(self)
129+
return "max".wrap(self)
130130
}
131131

132132
/// Builds a copy of the expression wrapped with the `min` aggregate
@@ -139,7 +139,7 @@ extension ExpressionType where UnderlyingType : _OptionalType, UnderlyingType.Wr
139139
/// - Returns: A copy of the expression wrapped with the `min` aggregate
140140
/// function.
141141
public var min: Expression<UnderlyingType> {
142-
return wrap(self)
142+
return "min".wrap(self)
143143
}
144144

145145
}
@@ -169,7 +169,7 @@ extension ExpressionType where UnderlyingType : Value, UnderlyingType.Datatype :
169169
/// - Returns: A copy of the expression wrapped with the `min` aggregate
170170
/// function.
171171
public var sum: Expression<UnderlyingType?> {
172-
return wrap(self)
172+
return "sum".wrap(self)
173173
}
174174

175175
/// Builds a copy of the expression wrapped with the `total` aggregate
@@ -182,7 +182,7 @@ extension ExpressionType where UnderlyingType : Value, UnderlyingType.Datatype :
182182
/// - Returns: A copy of the expression wrapped with the `min` aggregate
183183
/// function.
184184
public var total: Expression<Double> {
185-
return wrap(self)
185+
return "total".wrap(self)
186186
}
187187

188188
}
@@ -212,7 +212,7 @@ extension ExpressionType where UnderlyingType : _OptionalType, UnderlyingType.Wr
212212
/// - Returns: A copy of the expression wrapped with the `min` aggregate
213213
/// function.
214214
public var sum: Expression<UnderlyingType> {
215-
return wrap(self)
215+
return "sum".wrap(self)
216216
}
217217

218218
/// Builds a copy of the expression wrapped with the `total` aggregate
@@ -225,15 +225,15 @@ extension ExpressionType where UnderlyingType : _OptionalType, UnderlyingType.Wr
225225
/// - Returns: A copy of the expression wrapped with the `min` aggregate
226226
/// function.
227227
public var total: Expression<Double> {
228-
return wrap(self)
228+
return "total".wrap(self)
229229
}
230230

231231
}
232232

233233
extension ExpressionType where UnderlyingType == Int {
234234

235235
static func count(_ star: Star) -> Expression<UnderlyingType> {
236-
return wrap(star(nil, nil))
236+
return "count".wrap(star(nil, nil))
237237
}
238238

239239
}

Sources/SQLite/Typed/CoreFunctions.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ extension ExpressionType where UnderlyingType == Double {
6868
/// - Returns: A copy of the expression wrapped with the `round` function.
6969
public func round(_ precision: Int? = nil) -> Expression<UnderlyingType> {
7070
guard let precision = precision else {
71-
return wrap([self])
71+
return "round".wrap([self])
7272
}
73-
return wrap([self, Int(precision)])
73+
return "round".wrap([self, Int(precision)])
7474
}
7575

7676
}
@@ -88,9 +88,9 @@ extension ExpressionType where UnderlyingType == Double? {
8888
/// - Returns: A copy of the expression wrapped with the `round` function.
8989
public func round(_ precision: Int? = nil) -> Expression<UnderlyingType> {
9090
guard let precision = precision else {
91-
return wrap(self)
91+
return "round".wrap(self)
9292
}
93-
return wrap([self, Int(precision)])
93+
return "round".wrap([self, Int(precision)])
9494
}
9595

9696
}
@@ -143,7 +143,7 @@ extension ExpressionType where UnderlyingType == Data {
143143
///
144144
/// - Returns: A copy of the expression wrapped with the `length` function.
145145
public var length: Expression<Int> {
146-
return wrap(self)
146+
return "length".wrap(self)
147147
}
148148

149149
}
@@ -158,7 +158,7 @@ extension ExpressionType where UnderlyingType == Data? {
158158
///
159159
/// - Returns: A copy of the expression wrapped with the `length` function.
160160
public var length: Expression<Int?> {
161-
return wrap(self)
161+
return "length".wrap(self)
162162
}
163163

164164
}
@@ -173,7 +173,7 @@ extension ExpressionType where UnderlyingType == String {
173173
///
174174
/// - Returns: A copy of the expression wrapped with the `length` function.
175175
public var length: Expression<Int> {
176-
return wrap(self)
176+
return "length".wrap(self)
177177
}
178178

179179
/// Builds a copy of the expression wrapped with the `lower` function.
@@ -317,9 +317,9 @@ extension ExpressionType where UnderlyingType == String {
317317
/// - Returns: A copy of the expression wrapped with the `ltrim` function.
318318
public func ltrim(_ characters: Set<Character>? = nil) -> Expression<UnderlyingType> {
319319
guard let characters = characters else {
320-
return wrap(self)
320+
return "ltrim".wrap(self)
321321
}
322-
return wrap([self, String(characters)])
322+
return "ltrim".wrap([self, String(characters)])
323323
}
324324

325325
/// Builds a copy of the expression wrapped with the `rtrim` function.
@@ -335,9 +335,9 @@ extension ExpressionType where UnderlyingType == String {
335335
/// - Returns: A copy of the expression wrapped with the `rtrim` function.
336336
public func rtrim(_ characters: Set<Character>? = nil) -> Expression<UnderlyingType> {
337337
guard let characters = characters else {
338-
return wrap(self)
338+
return "rtrim".wrap(self)
339339
}
340-
return wrap([self, String(characters)])
340+
return "rtrim".wrap([self, String(characters)])
341341
}
342342

343343
/// Builds a copy of the expression wrapped with the `trim` function.
@@ -353,9 +353,9 @@ extension ExpressionType where UnderlyingType == String {
353353
/// - Returns: A copy of the expression wrapped with the `trim` function.
354354
public func trim(_ characters: Set<Character>? = nil) -> Expression<UnderlyingType> {
355355
guard let characters = characters else {
356-
return wrap([self])
356+
return "trim".wrap([self])
357357
}
358-
return wrap([self, String(characters)])
358+
return "trim".wrap([self, String(characters)])
359359
}
360360

361361
/// Builds a copy of the expression wrapped with the `replace` function.
@@ -398,7 +398,7 @@ extension ExpressionType where UnderlyingType == String? {
398398
///
399399
/// - Returns: A copy of the expression wrapped with the `length` function.
400400
public var length: Expression<Int?> {
401-
return wrap(self)
401+
return "length".wrap(self)
402402
}
403403

404404
/// Builds a copy of the expression wrapped with the `lower` function.
@@ -542,9 +542,9 @@ extension ExpressionType where UnderlyingType == String? {
542542
/// - Returns: A copy of the expression wrapped with the `ltrim` function.
543543
public func ltrim(_ characters: Set<Character>? = nil) -> Expression<UnderlyingType> {
544544
guard let characters = characters else {
545-
return wrap(self)
545+
return "ltrim".wrap(self)
546546
}
547-
return wrap([self, String(characters)])
547+
return "ltrim".wrap([self, String(characters)])
548548
}
549549

550550
/// Builds a copy of the expression wrapped with the `rtrim` function.
@@ -560,9 +560,9 @@ extension ExpressionType where UnderlyingType == String? {
560560
/// - Returns: A copy of the expression wrapped with the `rtrim` function.
561561
public func rtrim(_ characters: Set<Character>? = nil) -> Expression<UnderlyingType> {
562562
guard let characters = characters else {
563-
return wrap(self)
563+
return "rtrim".wrap(self)
564564
}
565-
return wrap([self, String(characters)])
565+
return "rtrim".wrap([self, String(characters)])
566566
}
567567

568568
/// Builds a copy of the expression wrapped with the `trim` function.
@@ -578,9 +578,9 @@ extension ExpressionType where UnderlyingType == String? {
578578
/// - Returns: A copy of the expression wrapped with the `trim` function.
579579
public func trim(_ characters: Set<Character>? = nil) -> Expression<UnderlyingType> {
580580
guard let characters = characters else {
581-
return wrap(self)
581+
return "trim".wrap(self)
582582
}
583-
return wrap([self, String(characters)])
583+
return "trim".wrap([self, String(characters)])
584584
}
585585

586586
/// Builds a copy of the expression wrapped with the `replace` function.

0 commit comments

Comments
 (0)