@@ -85,7 +85,7 @@ class SQLStatementTests: XCTestCase {
85
85
" content " text not null,
86
86
" createdAt " text not null,
87
87
" commentPostId " text not null,
88
- foreign key( " commentPostId " ) references Post( " id " )
88
+ foreign key( " commentPostId " ) references " Post " ( " id " )
89
89
on delete cascade
90
90
);
91
91
"""
@@ -106,7 +106,7 @@ class SQLStatementTests: XCTestCase {
106
106
create table if not exists " UserProfile " (
107
107
" id " text primary key not null,
108
108
" accountId " text not null unique,
109
- foreign key( " accountId " ) references UserAccount( " id " )
109
+ foreign key( " accountId " ) references " UserAccount " ( " id " )
110
110
on delete cascade
111
111
);
112
112
"""
@@ -128,9 +128,9 @@ class SQLStatementTests: XCTestCase {
128
128
" id " text primary key not null,
129
129
" authorId " text not null,
130
130
" bookId " text not null,
131
- foreign key( " authorId " ) references Author( " id " )
131
+ foreign key( " authorId " ) references " Author " ( " id " )
132
132
on delete cascade
133
- foreign key( " bookId " ) references Book( " id " )
133
+ foreign key( " bookId " ) references " Book " ( " id " )
134
134
on delete cascade
135
135
);
136
136
"""
@@ -153,7 +153,7 @@ class SQLStatementTests: XCTestCase {
153
153
let statement = InsertStatement ( model: post, modelSchema: post. schema)
154
154
155
155
let expectedStatement = """
156
- insert into Post ( " id " , " content " , " createdAt " , " draft " , " rating " , " status " , " title " , " updatedAt " )
156
+ insert into " Post " ( " id " , " content " , " createdAt " , " draft " , " rating " , " status " , " title " , " updatedAt " )
157
157
values (?, ?, ?, ?, ?, ?, ?, ?)
158
158
"""
159
159
XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -178,7 +178,7 @@ class SQLStatementTests: XCTestCase {
178
178
let statement = InsertStatement ( model: comment, modelSchema: comment. schema)
179
179
180
180
let expectedStatement = """
181
- insert into Comment ( " id " , " content " , " createdAt " , " commentPostId " )
181
+ insert into " Comment " ( " id " , " content " , " createdAt " , " commentPostId " )
182
182
values (?, ?, ?, ?)
183
183
"""
184
184
XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -265,7 +265,7 @@ class SQLStatementTests: XCTestCase {
265
265
let statement = DeleteStatement ( modelSchema: Post . schema, withId: id)
266
266
267
267
let expectedStatement = """
268
- delete from Post as root
268
+ delete from " Post " as root
269
269
where 1 = 1
270
270
and " root " . " id " = ?
271
271
"""
@@ -288,7 +288,7 @@ class SQLStatementTests: XCTestCase {
288
288
predicate: Post . keys. content == " content " )
289
289
290
290
let expectedStatement = """
291
- delete from Post as root
291
+ delete from " Post " as root
292
292
where 1 = 1
293
293
and (
294
294
" root " . " id " = ?
@@ -316,7 +316,7 @@ class SQLStatementTests: XCTestCase {
316
316
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
317
317
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
318
318
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
319
- from Post as " root "
319
+ from " Post " as " root "
320
320
"""
321
321
XCTAssertEqual ( statement. stringValue, expectedStatement)
322
322
}
@@ -337,7 +337,7 @@ class SQLStatementTests: XCTestCase {
337
337
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
338
338
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
339
339
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
340
- from Post as " root "
340
+ from " Post " as " root "
341
341
where 1 = 1
342
342
and (
343
343
" root " . " draft " = ?
@@ -373,8 +373,8 @@ class SQLStatementTests: XCTestCase {
373
373
" root " . " commentPostId " as " commentPostId " , " post " . " id " as " post.id " , " post " . " content " as " post.content " ,
374
374
" post " . " createdAt " as " post.createdAt " , " post " . " draft " as " post.draft " , " post " . " rating " as " post.rating " ,
375
375
" post " . " status " as " post.status " , " post " . " title " as " post.title " , " post " . " updatedAt " as " post.updatedAt "
376
- from Comment as " root "
377
- inner join Post as " post "
376
+ from " Comment " as " root "
377
+ inner join " Post " as " post "
378
378
on " post " . " id " = " root " . " commentPostId "
379
379
where 1 = 1
380
380
and (
@@ -406,8 +406,8 @@ class SQLStatementTests: XCTestCase {
406
406
" root " . " commentPostId " as " commentPostId " , " post " . " id " as " post.id " , " post " . " content " as " post.content " ,
407
407
" post " . " createdAt " as " post.createdAt " , " post " . " draft " as " post.draft " , " post " . " rating " as " post.rating " ,
408
408
" post " . " status " as " post.status " , " post " . " title " as " post.title " , " post " . " updatedAt " as " post.updatedAt "
409
- from Comment as " root "
410
- inner join Post as " post "
409
+ from " Comment " as " root "
410
+ inner join " Post " as " post "
411
411
on " post " . " id " = " root " . " commentPostId "
412
412
"""
413
413
XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -429,7 +429,7 @@ class SQLStatementTests: XCTestCase {
429
429
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
430
430
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
431
431
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
432
- from Post as " root "
432
+ from " Post " as " root "
433
433
limit 20 offset 40
434
434
"""
435
435
XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -452,7 +452,7 @@ class SQLStatementTests: XCTestCase {
452
452
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
453
453
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
454
454
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
455
- from Post as " root "
455
+ from " Post " as " root "
456
456
order by " root " . " id " asc
457
457
"""
458
458
XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -475,7 +475,7 @@ class SQLStatementTests: XCTestCase {
475
475
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
476
476
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
477
477
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
478
- from Post as " root "
478
+ from " Post " as " root "
479
479
order by " root " . " id " asc, " root " . " createdAt " desc
480
480
"""
481
481
XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -498,7 +498,7 @@ class SQLStatementTests: XCTestCase {
498
498
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
499
499
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
500
500
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
501
- from Post as " root "
501
+ from " Post " as " root "
502
502
where 1 = 1
503
503
and " root " . " rating " > ?
504
504
order by " root " . " id " desc
@@ -524,7 +524,7 @@ class SQLStatementTests: XCTestCase {
524
524
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
525
525
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
526
526
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
527
- from Post as " root "
527
+ from " Post " as " root "
528
528
order by " root " . " id " desc
529
529
limit 5 offset 0
530
530
"""
@@ -551,7 +551,7 @@ class SQLStatementTests: XCTestCase {
551
551
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
552
552
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
553
553
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
554
- from Post as " root "
554
+ from " Post " as " root "
555
555
where 1 = 1
556
556
and " root " . " rating " > ?
557
557
order by " root " . " id " desc
@@ -701,7 +701,7 @@ class SQLStatementTests: XCTestCase {
701
701
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
702
702
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
703
703
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
704
- from Post as " root "
704
+ from " Post " as " root "
705
705
where 1 = 1
706
706
and (
707
707
(
@@ -736,7 +736,7 @@ class SQLStatementTests: XCTestCase {
736
736
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
737
737
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
738
738
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
739
- from Post as " root "
739
+ from " Post " as " root "
740
740
where 1 = 1
741
741
and (
742
742
(
@@ -771,7 +771,7 @@ class SQLStatementTests: XCTestCase {
771
771
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
772
772
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
773
773
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
774
- from Post as " root "
774
+ from " Post " as " root "
775
775
where 1 = 1
776
776
and (
777
777
(
@@ -810,7 +810,7 @@ class SQLStatementTests: XCTestCase {
810
810
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
811
811
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
812
812
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
813
- from Post as " root "
813
+ from " Post " as " root "
814
814
where 1 = 1
815
815
and (
816
816
(
@@ -850,7 +850,7 @@ class SQLStatementTests: XCTestCase {
850
850
" root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
851
851
" root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
852
852
" root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
853
- from Post as " root "
853
+ from " Post " as " root "
854
854
where 1 = 1
855
855
and (
856
856
(
0 commit comments