Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 18bb7f4

Browse files
committed
Fixed Can_retrieve_LastInsertId_from_inserted_table to work whether SQL server quotes column names or not
1 parent cc21876 commit 18bb7f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ServiceStack.OrmLite.PostgreSQL.Tests/OrmLiteInsertTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ public void Can_retrieve_LastInsertId_from_inserted_table()
113113
var row2 = new ModelWithIdAndName1() { Name = "B", Id = 5 };
114114

115115
var row1LastInsertId = db.Insert(row1, selectIdentity: true);
116-
Assert.That(db.GetLastSql(), Is.StringEnding(") RETURNING id"));
116+
Assert.That(db.GetLastSql(), Is.StringMatching("\\) RETURNING \"?id"));
117117

118118
var row2LastInsertId = db.Insert(row2, selectIdentity: true);
119-
Assert.That(db.GetLastSql(), Is.StringEnding(") RETURNING id"));
119+
Assert.That(db.GetLastSql(), Is.StringMatching("\\) RETURNING \"?id"));
120120

121121
var insertedRow1 = db.SingleById<ModelWithIdAndName1>(row1LastInsertId);
122122
var insertedRow2 = db.SingleById<ModelWithIdAndName1>(row2LastInsertId);

0 commit comments

Comments
 (0)