Fold work from SQLite into common
- Checkpoint before common moved to top level
This commit is contained in:
@@ -67,14 +67,30 @@ class QueryTest {
|
||||
@Test
|
||||
@DisplayName("insert generates correctly")
|
||||
fun insert() {
|
||||
assertEquals("INSERT INTO $tbl VALUES (:data)", Query.insert(tbl), "INSERT statement not constructed correctly")
|
||||
try {
|
||||
Configuration.connectionString = "postgresql"
|
||||
assertEquals(
|
||||
"INSERT INTO $tbl VALUES (:data)",
|
||||
Query.insert(tbl),
|
||||
"INSERT statement not constructed correctly"
|
||||
)
|
||||
} finally {
|
||||
Configuration.connectionString = null
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("save generates correctly")
|
||||
fun save() {
|
||||
assertEquals("INSERT INTO $tbl VALUES (:data) ON CONFLICT ((data->>'id')) DO UPDATE SET data = EXCLUDED.data",
|
||||
Query.save(tbl), "INSERT ON CONFLICT UPDATE statement not constructed correctly")
|
||||
try {
|
||||
Configuration.connectionString = "postgresql"
|
||||
assertEquals(
|
||||
"INSERT INTO $tbl VALUES (:data) ON CONFLICT ((data->>'id')) DO UPDATE SET data = EXCLUDED.data",
|
||||
Query.save(tbl), "INSERT ON CONFLICT UPDATE statement not constructed correctly"
|
||||
)
|
||||
} finally {
|
||||
Configuration.connectionString = null
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user