@@ -6,6 +6,15 @@ import Foundation
66struct TestUser : Schema , SchemaBuilder {
77 static let tableName = " test_users "
88
9+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
10+ \TestUser . id: " id " ,
11+ \TestUser . name: " name " ,
12+ \TestUser . email: " email " ,
13+ \TestUser . age: " age " ,
14+ \TestUser . isActive: " isActive " ,
15+ \TestUser . createdAt: " createdAt " ,
16+ ]
17+
918 @ID var id : UUID
1019 @Column var name : String
1120 @Column var email : String
@@ -46,6 +55,13 @@ struct TestUser: Schema, SchemaBuilder {
4655struct TestUserWithBio : Schema , SchemaBuilder {
4756 static let tableName = " test_users_bio "
4857
58+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
59+ \TestUserWithBio . id: " id " ,
60+ \TestUserWithBio . name: " name " ,
61+ \TestUserWithBio . email: " email " ,
62+ \TestUserWithBio . bio: " bio " ,
63+ ]
64+
4965 @ID var id : UUID
5066 @Column var name : String
5167 @Column var email : String
@@ -92,6 +108,12 @@ struct TestMacroUser {
92108struct TestColumnOverride : Schema , SchemaBuilder {
93109 static let tableName = " test_column_overrides "
94110
111+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
112+ \TestColumnOverride . id: " id " ,
113+ \TestColumnOverride . name: " name " ,
114+ \TestColumnOverride . email: " email " ,
115+ ]
116+
95117 @ID var id : UUID
96118 @Column ( " display_name " ) var name : String = " "
97119 @Column var email : String = " "
@@ -113,6 +135,12 @@ struct TestColumnOverride: Schema, SchemaBuilder {
113135struct TestWithUuidColumn : Schema , SchemaBuilder {
114136 static let tableName = " test_with_uuid_columns "
115137
138+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
139+ \TestWithUuidColumn . id: " id " ,
140+ \TestWithUuidColumn . externalId: " externalId " ,
141+ \TestWithUuidColumn . name: " name " ,
142+ ]
143+
116144 @ID var id : UUID
117145 @Column var externalId : UUID
118146 @Column var name : String
@@ -138,6 +166,11 @@ struct TestWithUuidColumn: Schema, SchemaBuilder {
138166struct IntPKItem : Schema , SchemaBuilder {
139167 static let tableName = " int_pk_items "
140168
169+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
170+ \IntPKItem . id: " id " ,
171+ \IntPKItem . name: " name " ,
172+ ]
173+
141174 @ID var id : Int
142175 @Column var name : String
143176
@@ -168,6 +201,11 @@ struct IntPKItem: Schema, SchemaBuilder {
168201struct StringPKItem : Schema , SchemaBuilder {
169202 static let tableName = " string_pk_items "
170203
204+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
205+ \StringPKItem . id: " id " ,
206+ \StringPKItem . name: " name " ,
207+ ]
208+
171209 @ID var id : String
172210 @Column var name : String
173211
@@ -193,6 +231,12 @@ struct StringPKItem: Schema, SchemaBuilder {
193231struct IntFKChild : Schema , SchemaBuilder {
194232 static let tableName = " int_fk_children "
195233
234+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
235+ \IntFKChild . id: " id " ,
236+ \IntFKChild . label: " label " ,
237+ \IntFKChild . parentId: " parentId " ,
238+ ]
239+
196240 @ID var id : UUID
197241 @Column var label : String
198242 @ForeignKey var parentId : Int
@@ -265,6 +309,14 @@ struct RelUserTag {
265309struct TestPost : Schema , SchemaBuilder {
266310 static let tableName = " test_posts "
267311
312+ nonisolated ( unsafe) static let _keyPathToColumn : [ AnyKeyPath : String ] = [
313+ \TestPost . id: " id " ,
314+ \TestPost . title: " title " ,
315+ \TestPost . body: " body " ,
316+ \TestPost . userId: " userId " ,
317+ \TestPost . createdAt: " createdAt " ,
318+ ]
319+
268320 @ID var id : UUID
269321 @Column var title : String
270322 @Column var body : String
0 commit comments