@@ -112,23 +112,41 @@ final class FluentPostgresDriverTests: XCTestCase {
112
112
try self . benchmarker. testUUIDModel ( )
113
113
}
114
114
115
+ func testNewModelDecode( ) throws {
116
+ try self . benchmarker. testNewModelDecode ( )
117
+ }
118
+
119
+ func testSiblingsAttach( ) throws {
120
+ try self . benchmarker. testSiblingsAttach ( )
121
+ }
122
+
123
+ func testSiblingsEagerLoad( ) throws {
124
+ try self . benchmarker. testSiblingsEagerLoad ( )
125
+ }
126
+
115
127
func testBlob( ) throws {
116
128
final class Foo : Model {
117
- @Field var id : Int ?
118
- @Field var data : [ UInt8 ]
129
+ static let schema = " foos "
130
+
131
+ @ID ( key: " id " )
132
+ var id : Int ?
133
+
134
+ @Field ( key: " data " )
135
+ var data : [ UInt8 ]
136
+
119
137
init ( ) { }
120
138
}
121
139
122
140
struct CreateFoo : Migration {
123
141
func prepare( on database: Database ) -> EventLoopFuture < Void > {
124
- return Foo . schema ( on : database )
125
- . field ( \ . $id , . int, . identifier( auto: true ) )
126
- . field ( \ . $ data, . data, . required)
142
+ return database . schema ( " foos " )
143
+ . field ( " id " , . int, . identifier( auto: true ) )
144
+ . field ( " data " , . data, . required)
127
145
. create ( )
128
146
}
129
147
130
148
func revert( on database: Database ) -> EventLoopFuture < Void > {
131
- return Foo . schema ( on : database ) . delete ( )
149
+ return database . schema ( " foos " ) . delete ( )
132
150
}
133
151
}
134
152
@@ -138,21 +156,27 @@ final class FluentPostgresDriverTests: XCTestCase {
138
156
139
157
func testSaveModelWithBool( ) throws {
140
158
final class Organization : Model {
141
- @Field var id : Int ?
142
- @Field var disabled : Bool
159
+ static let schema = " orgs "
160
+
161
+ @ID ( key: " id " )
162
+ var id : Int ?
163
+
164
+ @Field ( key: " disabled " )
165
+ var disabled : Bool
166
+
143
167
init ( ) { }
144
168
}
145
169
146
170
struct CreateOrganization : Migration {
147
171
func prepare( on database: Database ) -> EventLoopFuture < Void > {
148
- return Organization . schema ( on : database )
149
- . field ( \ . $id , . int, . identifier( auto: true ) )
150
- . field ( \ . $ disabled, . bool, . required)
172
+ return database . schema ( " orgs " )
173
+ . field ( " id " , . int, . identifier( auto: true ) )
174
+ . field ( " disabled " , . bool, . required)
151
175
. create ( )
152
176
}
153
177
154
178
func revert( on database: Database ) -> EventLoopFuture < Void > {
155
- return Organization . schema ( on : database ) . delete ( )
179
+ return database . schema ( " orgs " ) . delete ( )
156
180
}
157
181
}
158
182
0 commit comments