@@ -15,6 +15,25 @@ public struct SwiftLanguage: Language {
1515
1616 public var boolName : String { " Bool " }
1717
18+ public var builtinCoders : Set < String > {
19+ [
20+ " BoolDatabaseValueCoder " ,
21+ " Int8DatabaseValueCoder " ,
22+ " Int16DatabaseValueCoder " ,
23+ " Int32DatabaseValueCoder " ,
24+ " Int64DatabaseValueCoder " ,
25+ " UInt8DatabaseValueCoder " ,
26+ " UInt16DatabaseValueCoder " ,
27+ " UInt32DatabaseValueCoder " ,
28+ " UInt64DatabaseValueCoder " ,
29+ " UIntDatabaseValueCoder " ,
30+ " FloatDatabaseValueCoder " ,
31+ " Float16DatabaseValueCoder " ,
32+ " UUIDDatabaseValueCoder " ,
33+ " DecimalDatabaseValueCoder " ,
34+ ]
35+ }
36+
1837 public func queryTypeName(
1938 input: String ,
2039 output: String
@@ -51,8 +70,18 @@ public struct SwiftLanguage: Language {
5170 public func file(
5271 migrations: [ String ] ,
5372 tables: [ GeneratedModel ] ,
54- queries: [ ( String ? , [ GeneratedQuery ] ) ]
73+ queries: [ ( String ? , [ GeneratedQuery ] ) ] ,
74+ coders: [ String ]
5575 ) throws -> String {
76+ // Note: For now just going to ignore the `coders`
77+ // Kotlin will need that info which is why it exists.
78+ // Swift having less finegrained namespaces makes it
79+ // so it can just do module level lookups for the type.
80+ // where kotlin defining it just in the project isnt enough
81+ // cause it will be in a different namespace.
82+ //
83+ // Swift we may want to improve it. This is a good starting point though.
84+
5685 let allQueries = queries. flatMap ( \. 1 )
5786
5887 writer. write ( " import Foundation " )
0 commit comments