@@ -85,7 +85,7 @@ class SQLStatementTests: XCTestCase {
8585 " content " text not null,
8686 " createdAt " text not null,
8787 " commentPostId " text not null,
88- foreign key( " commentPostId " ) references Post( " id " )
88+ foreign key( " commentPostId " ) references " Post " ( " id " )
8989 on delete cascade
9090 );
9191 """
@@ -106,7 +106,7 @@ class SQLStatementTests: XCTestCase {
106106 create table if not exists " UserProfile " (
107107 " id " text primary key not null,
108108 " accountId " text not null unique,
109- foreign key( " accountId " ) references UserAccount( " id " )
109+ foreign key( " accountId " ) references " UserAccount " ( " id " )
110110 on delete cascade
111111 );
112112 """
@@ -128,9 +128,9 @@ class SQLStatementTests: XCTestCase {
128128 " id " text primary key not null,
129129 " authorId " text not null,
130130 " bookId " text not null,
131- foreign key( " authorId " ) references Author( " id " )
131+ foreign key( " authorId " ) references " Author " ( " id " )
132132 on delete cascade
133- foreign key( " bookId " ) references Book( " id " )
133+ foreign key( " bookId " ) references " Book " ( " id " )
134134 on delete cascade
135135 );
136136 """
@@ -153,7 +153,7 @@ class SQLStatementTests: XCTestCase {
153153 let statement = InsertStatement ( model: post, modelSchema: post. schema)
154154
155155 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 " )
157157 values (?, ?, ?, ?, ?, ?, ?, ?)
158158 """
159159 XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -178,7 +178,7 @@ class SQLStatementTests: XCTestCase {
178178 let statement = InsertStatement ( model: comment, modelSchema: comment. schema)
179179
180180 let expectedStatement = """
181- insert into Comment ( " id " , " content " , " createdAt " , " commentPostId " )
181+ insert into " Comment " ( " id " , " content " , " createdAt " , " commentPostId " )
182182 values (?, ?, ?, ?)
183183 """
184184 XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -265,7 +265,7 @@ class SQLStatementTests: XCTestCase {
265265 let statement = DeleteStatement ( modelSchema: Post . schema, withId: id)
266266
267267 let expectedStatement = """
268- delete from Post as root
268+ delete from " Post " as root
269269 where 1 = 1
270270 and " root " . " id " = ?
271271 """
@@ -288,7 +288,7 @@ class SQLStatementTests: XCTestCase {
288288 predicate: Post . keys. content == " content " )
289289
290290 let expectedStatement = """
291- delete from Post as root
291+ delete from " Post " as root
292292 where 1 = 1
293293 and (
294294 " root " . " id " = ?
@@ -316,7 +316,7 @@ class SQLStatementTests: XCTestCase {
316316 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
317317 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
318318 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
319- from Post as " root "
319+ from " Post " as " root "
320320 """
321321 XCTAssertEqual ( statement. stringValue, expectedStatement)
322322 }
@@ -337,7 +337,7 @@ class SQLStatementTests: XCTestCase {
337337 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
338338 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
339339 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
340- from Post as " root "
340+ from " Post " as " root "
341341 where 1 = 1
342342 and (
343343 " root " . " draft " = ?
@@ -373,8 +373,8 @@ class SQLStatementTests: XCTestCase {
373373 " root " . " commentPostId " as " commentPostId " , " post " . " id " as " post.id " , " post " . " content " as " post.content " ,
374374 " post " . " createdAt " as " post.createdAt " , " post " . " draft " as " post.draft " , " post " . " rating " as " post.rating " ,
375375 " 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 "
378378 on " post " . " id " = " root " . " commentPostId "
379379 where 1 = 1
380380 and (
@@ -406,8 +406,8 @@ class SQLStatementTests: XCTestCase {
406406 " root " . " commentPostId " as " commentPostId " , " post " . " id " as " post.id " , " post " . " content " as " post.content " ,
407407 " post " . " createdAt " as " post.createdAt " , " post " . " draft " as " post.draft " , " post " . " rating " as " post.rating " ,
408408 " 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 "
411411 on " post " . " id " = " root " . " commentPostId "
412412 """
413413 XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -429,7 +429,7 @@ class SQLStatementTests: XCTestCase {
429429 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
430430 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
431431 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
432- from Post as " root "
432+ from " Post " as " root "
433433 limit 20 offset 40
434434 """
435435 XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -452,7 +452,7 @@ class SQLStatementTests: XCTestCase {
452452 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
453453 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
454454 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
455- from Post as " root "
455+ from " Post " as " root "
456456 order by " root " . " id " asc
457457 """
458458 XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -475,7 +475,7 @@ class SQLStatementTests: XCTestCase {
475475 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
476476 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
477477 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
478- from Post as " root "
478+ from " Post " as " root "
479479 order by " root " . " id " asc, " root " . " createdAt " desc
480480 """
481481 XCTAssertEqual ( statement. stringValue, expectedStatement)
@@ -498,7 +498,7 @@ class SQLStatementTests: XCTestCase {
498498 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
499499 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
500500 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
501- from Post as " root "
501+ from " Post " as " root "
502502 where 1 = 1
503503 and " root " . " rating " > ?
504504 order by " root " . " id " desc
@@ -524,7 +524,7 @@ class SQLStatementTests: XCTestCase {
524524 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
525525 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
526526 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
527- from Post as " root "
527+ from " Post " as " root "
528528 order by " root " . " id " desc
529529 limit 5 offset 0
530530 """
@@ -551,7 +551,7 @@ class SQLStatementTests: XCTestCase {
551551 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
552552 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
553553 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
554- from Post as " root "
554+ from " Post " as " root "
555555 where 1 = 1
556556 and " root " . " rating " > ?
557557 order by " root " . " id " desc
@@ -701,7 +701,7 @@ class SQLStatementTests: XCTestCase {
701701 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
702702 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
703703 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
704- from Post as " root "
704+ from " Post " as " root "
705705 where 1 = 1
706706 and (
707707 (
@@ -736,7 +736,7 @@ class SQLStatementTests: XCTestCase {
736736 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
737737 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
738738 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
739- from Post as " root "
739+ from " Post " as " root "
740740 where 1 = 1
741741 and (
742742 (
@@ -771,7 +771,7 @@ class SQLStatementTests: XCTestCase {
771771 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
772772 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
773773 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
774- from Post as " root "
774+ from " Post " as " root "
775775 where 1 = 1
776776 and (
777777 (
@@ -810,7 +810,7 @@ class SQLStatementTests: XCTestCase {
810810 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
811811 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
812812 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
813- from Post as " root "
813+ from " Post " as " root "
814814 where 1 = 1
815815 and (
816816 (
@@ -850,7 +850,7 @@ class SQLStatementTests: XCTestCase {
850850 " root " . " id " as " id " , " root " . " content " as " content " , " root " . " createdAt " as " createdAt " ,
851851 " root " . " draft " as " draft " , " root " . " rating " as " rating " , " root " . " status " as " status " ,
852852 " root " . " title " as " title " , " root " . " updatedAt " as " updatedAt "
853- from Post as " root "
853+ from " Post " as " root "
854854 where 1 = 1
855855 and (
856856 (
0 commit comments