Skip to content

Commit bc63d3a

Browse files
committed
swiftlint fix
1 parent 92760e0 commit bc63d3a

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

Sources/SQLite/Typed/Coding.swift

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extension QueryType {
4444
try encodable.encode(to: encoder)
4545
return self.insert(encoder.setters + otherSetters)
4646
}
47-
47+
4848
/// Creates an `INSERT` statement by encoding the given object
4949
/// This method converts any custom nested types to JSON data and does not handle any sort
5050
/// of object relationships. If you want to support relationships between objects you will
@@ -69,7 +69,7 @@ extension QueryType {
6969
try encodable.encode(to: encoder)
7070
return self.insert(or: onConflict, encoder.setters + otherSetters)
7171
}
72-
72+
7373
/// Creates a batch `INSERT` statement by encoding the array of given objects
7474
/// This method converts any custom nested types to JSON data and does not handle any sort
7575
/// of object relationships. If you want to support relationships between objects you will
@@ -93,7 +93,7 @@ extension QueryType {
9393
}
9494
return self.insertMany(combinedSetters)
9595
}
96-
96+
9797
/// Creates an `INSERT ON CONFLICT DO UPDATE` statement, aka upsert, by encoding the given object
9898
/// This method converts any custom nested types to JSON data and does not handle any sort
9999
/// of object relationships. If you want to support relationships between objects you will
@@ -116,7 +116,7 @@ extension QueryType {
116116
try encodable.encode(to: encoder)
117117
return self.upsert(encoder.setters + otherSetters, onConflictOf: conflicting)
118118
}
119-
119+
120120
/// Creates an `UPDATE` statement by encoding the given object
121121
/// This method converts any custom nested types to JSON data and does not handle any sort
122122
/// of object relationships. If you want to support relationships between objects you will
@@ -151,7 +151,7 @@ extension Row {
151151
public func decode<V: Decodable>(userInfo: [CodingUserInfoKey: Any] = [:]) throws -> V {
152152
try V(from: decoder(userInfo: userInfo))
153153
}
154-
154+
155155
public func decoder(userInfo: [CodingUserInfoKey: Any] = [:]) -> Decoder {
156156
SQLiteDecoder(row: self, userInfo: userInfo)
157157
}
@@ -162,46 +162,46 @@ private class SQLiteEncoder: Encoder {
162162
class SQLiteKeyedEncodingContainer<MyKey: CodingKey>: KeyedEncodingContainerProtocol {
163163
// swiftlint:disable nesting
164164
typealias Key = MyKey
165-
165+
166166
let encoder: SQLiteEncoder
167167
let codingPath: [CodingKey] = []
168-
168+
169169
init(encoder: SQLiteEncoder) {
170170
self.encoder = encoder
171171
}
172-
172+
173173
func superEncoder() -> Swift.Encoder {
174174
fatalError("SQLiteEncoding does not support super encoders")
175175
}
176-
176+
177177
func superEncoder(forKey key: Key) -> Swift.Encoder {
178178
fatalError("SQLiteEncoding does not support super encoders")
179179
}
180-
180+
181181
func encodeNil(forKey key: SQLiteEncoder.SQLiteKeyedEncodingContainer<Key>.Key) throws {
182182
encoder.setters.append(Expression<String?>(key.stringValue) <- nil)
183183
}
184-
184+
185185
func encode(_ value: Int, forKey key: SQLiteEncoder.SQLiteKeyedEncodingContainer<Key>.Key) throws {
186186
encoder.setters.append(Expression(key.stringValue) <- value)
187187
}
188-
188+
189189
func encode(_ value: Bool, forKey key: Key) throws {
190190
encoder.setters.append(Expression(key.stringValue) <- value)
191191
}
192-
192+
193193
func encode(_ value: Float, forKey key: Key) throws {
194194
encoder.setters.append(Expression(key.stringValue) <- Double(value))
195195
}
196-
196+
197197
func encode(_ value: Double, forKey key: Key) throws {
198198
encoder.setters.append(Expression(key.stringValue) <- value)
199199
}
200-
200+
201201
func encode(_ value: String, forKey key: Key) throws {
202202
encoder.setters.append(Expression(key.stringValue) <- value)
203203
}
204-
204+
205205
func encode<T>(_ value: T, forKey key: Key) throws where T: Swift.Encodable {
206206
switch value {
207207
case let data as Data:
@@ -216,77 +216,77 @@ private class SQLiteEncoder: Encoder {
216216
encoder.setters.append(Expression(key.stringValue) <- string)
217217
}
218218
}
219-
219+
220220
func encode(_ value: Int8, forKey key: Key) throws {
221221
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
222222
debugDescription: "encoding an Int8 is not supported"))
223223
}
224-
224+
225225
func encode(_ value: Int16, forKey key: Key) throws {
226226
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
227227
debugDescription: "encoding an Int16 is not supported"))
228228
}
229-
229+
230230
func encode(_ value: Int32, forKey key: Key) throws {
231231
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
232232
debugDescription: "encoding an Int32 is not supported"))
233233
}
234-
234+
235235
func encode(_ value: Int64, forKey key: Key) throws {
236236
encoder.setters.append(Expression(key.stringValue) <- value)
237237
}
238-
238+
239239
func encode(_ value: UInt, forKey key: Key) throws {
240240
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
241241
debugDescription: "encoding an UInt is not supported"))
242242
}
243-
243+
244244
func encode(_ value: UInt8, forKey key: Key) throws {
245245
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
246246
debugDescription: "encoding an UInt8 is not supported"))
247247
}
248-
248+
249249
func encode(_ value: UInt16, forKey key: Key) throws {
250250
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
251251
debugDescription: "encoding an UInt16 is not supported"))
252252
}
253-
253+
254254
func encode(_ value: UInt32, forKey key: Key) throws {
255255
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
256256
debugDescription: "encoding an UInt32 is not supported"))
257257
}
258-
258+
259259
func encode(_ value: UInt64, forKey key: Key) throws {
260260
throw EncodingError.invalidValue(value, EncodingError.Context(codingPath: codingPath,
261261
debugDescription: "encoding an UInt64 is not supported"))
262262
}
263-
263+
264264
func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type, forKey key: Key)
265265
-> KeyedEncodingContainer<NestedKey> where NestedKey: CodingKey {
266266
fatalError("encoding a nested container is not supported")
267267
}
268-
268+
269269
func nestedUnkeyedContainer(forKey key: Key) -> UnkeyedEncodingContainer {
270270
fatalError("encoding nested values is not supported")
271271
}
272272
}
273-
273+
274274
fileprivate var setters: [Setter] = []
275275
let codingPath: [CodingKey] = []
276276
let userInfo: [CodingUserInfoKey: Any]
277-
277+
278278
init(userInfo: [CodingUserInfoKey: Any]) {
279279
self.userInfo = userInfo
280280
}
281-
281+
282282
func singleValueContainer() -> SingleValueEncodingContainer {
283283
fatalError("not supported")
284284
}
285-
285+
286286
func unkeyedContainer() -> UnkeyedEncodingContainer {
287287
fatalError("not supported")
288288
}
289-
289+
290290
func container<Key>(keyedBy type: Key.Type) -> KeyedEncodingContainer<Key> where Key: CodingKey {
291291
KeyedEncodingContainer(SQLiteKeyedEncodingContainer(encoder: self))
292292
}
@@ -295,91 +295,91 @@ private class SQLiteEncoder: Encoder {
295295
private class SQLiteDecoder: Decoder {
296296
class SQLiteKeyedDecodingContainer<MyKey: CodingKey>: KeyedDecodingContainerProtocol {
297297
typealias Key = MyKey
298-
298+
299299
let codingPath: [CodingKey] = []
300300
let row: Row
301-
301+
302302
init(row: Row) {
303303
self.row = row
304304
}
305-
305+
306306
var allKeys: [Key] {
307307
row.columnNames.keys.compactMap({ Key(stringValue: $0) })
308308
}
309-
309+
310310
func contains(_ key: Key) -> Bool {
311311
row.hasValue(for: key.stringValue)
312312
}
313-
313+
314314
func decodeNil(forKey key: Key) throws -> Bool {
315315
!contains(key)
316316
}
317-
317+
318318
func decode(_ type: Bool.Type, forKey key: Key) throws -> Bool {
319319
try row.get(Expression(key.stringValue))
320320
}
321-
321+
322322
func decode(_ type: Int.Type, forKey key: Key) throws -> Int {
323323
try row.get(Expression(key.stringValue))
324324
}
325-
325+
326326
func decode(_ type: Int8.Type, forKey key: Key) throws -> Int8 {
327327
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
328328
debugDescription: "decoding an Int8 is not supported"))
329329
}
330-
330+
331331
func decode(_ type: Int16.Type, forKey key: Key) throws -> Int16 {
332332
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
333333
debugDescription: "decoding an Int16 is not supported"))
334334
}
335-
335+
336336
func decode(_ type: Int32.Type, forKey key: Key) throws -> Int32 {
337337
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
338338
debugDescription: "decoding an Int32 is not supported"))
339339
}
340-
340+
341341
func decode(_ type: Int64.Type, forKey key: Key) throws -> Int64 {
342342
try row.get(Expression(key.stringValue))
343343
}
344-
344+
345345
func decode(_ type: UInt.Type, forKey key: Key) throws -> UInt {
346346
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
347347
debugDescription: "decoding an UInt is not supported"))
348-
348+
349349
}
350-
350+
351351
func decode(_ type: UInt8.Type, forKey key: Key) throws -> UInt8 {
352352
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
353353
debugDescription: "decoding an UInt8 is not supported"))
354354
}
355-
355+
356356
func decode(_ type: UInt16.Type, forKey key: Key) throws -> UInt16 {
357357
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
358358
debugDescription: "decoding an UInt16 is not supported"))
359359
}
360-
360+
361361
func decode(_ type: UInt32.Type, forKey key: Key) throws -> UInt32 {
362362
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
363363
debugDescription: "decoding an UInt32 is not supported"))
364364
}
365-
365+
366366
func decode(_ type: UInt64.Type, forKey key: Key) throws -> UInt64 {
367367
throw DecodingError.typeMismatch(type, DecodingError.Context(codingPath: codingPath,
368368
debugDescription: "decoding an UInt64 is not supported"))
369369
}
370-
370+
371371
func decode(_ type: Float.Type, forKey key: Key) throws -> Float {
372372
Float(try row.get(Expression<Double>(key.stringValue)))
373373
}
374-
374+
375375
func decode(_ type: Double.Type, forKey key: Key) throws -> Double {
376376
try row.get(Expression(key.stringValue))
377377
}
378-
378+
379379
func decode(_ type: String.Type, forKey key: Key) throws -> String {
380380
try row.get(Expression(key.stringValue))
381381
}
382-
382+
383383
func decode<T>(_ type: T.Type, forKey key: Key) throws -> T where T: Swift.Decodable {
384384
// swiftlint:disable force_cast
385385
switch type {
@@ -405,47 +405,47 @@ private class SQLiteDecoder: Decoder {
405405
return try JSONDecoder().decode(type, from: data)
406406
}
407407
}
408-
408+
409409
func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type, forKey key: Key) throws
410410
-> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey {
411411
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: codingPath,
412412
debugDescription: "decoding nested containers is not supported"))
413413
}
414-
414+
415415
func nestedUnkeyedContainer(forKey key: Key) throws -> UnkeyedDecodingContainer {
416416
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: codingPath,
417417
debugDescription: "decoding unkeyed containers is not supported"))
418418
}
419-
419+
420420
func superDecoder() throws -> Swift.Decoder {
421421
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: codingPath,
422422
debugDescription: "decoding super encoders containers is not supported"))
423423
}
424-
424+
425425
func superDecoder(forKey key: Key) throws -> Swift.Decoder {
426426
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: codingPath,
427427
debugDescription: "decoding super decoders is not supported"))
428428
}
429429
}
430-
430+
431431
let row: Row
432432
let codingPath: [CodingKey] = []
433433
let userInfo: [CodingUserInfoKey: Any]
434-
434+
435435
init(row: Row, userInfo: [CodingUserInfoKey: Any]) {
436436
self.row = row
437437
self.userInfo = userInfo
438438
}
439-
439+
440440
func container<Key>(keyedBy type: Key.Type) throws -> KeyedDecodingContainer<Key> where Key: CodingKey {
441441
KeyedDecodingContainer(SQLiteKeyedDecodingContainer(row: row))
442442
}
443-
443+
444444
func unkeyedContainer() throws -> UnkeyedDecodingContainer {
445445
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: codingPath,
446446
debugDescription: "decoding an unkeyed container is not supported"))
447447
}
448-
448+
449449
func singleValueContainer() throws -> SingleValueDecodingContainer {
450450
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: codingPath,
451451
debugDescription: "decoding a single value container is not supported"))

0 commit comments

Comments
 (0)