Skip to content

Commit a3ef5cd

Browse files
committed
test(integration-tests-kotlin): coerce a date filter operand on SQLite and read min/max timestamps there
The Kotlin SQLite lane spells a DATE column's SQL type as TEXT, so the string operand of a date filter reached Exposed uncoerced; key the coercion on the column type as well. The report-time-min-max seed now spells its timestamps in the form the SQLite driver's date_string_format parses (fixture seed only; expect blocks unchanged).
1 parent a701c02 commit a3ef5cd

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎fixtures/persistence-conformance/queries/report-time-min-max.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ seed-data: |
1414
("id","ownerId","externalId","payload","recordedAt","observedAt","asOfDate","atTime")
1515
VALUES
1616
('11111111-1111-4111-8111-111111111111', 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa',
17-
NULL, NULL, '2026-05-04T03:30:00Z', '2026-05-04T03:30:00', '2026-05-03', '03:30:00'),
17+
NULL, NULL, '2026-05-04T03:30:00.000Z', '2026-05-04 03:30:00', '2026-05-03', '03:30:00'),
1818
('22222222-2222-4222-8222-222222222222', 'bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb',
19-
NULL, NULL, '2026-05-04T22:10:00Z', '2026-05-04T22:10:00', '2026-05-20', '22:10:00'),
19+
NULL, NULL, '2026-05-04T22:10:00.000Z', '2026-05-04 22:10:00', '2026-05-20', '22:10:00'),
2020
('33333333-3333-4333-8333-333333333333', 'bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb',
21-
NULL, NULL, '2026-05-04T23:30:00Z', '2026-05-04T23:30:00', '2026-06-01', '23:30:00'),
21+
NULL, NULL, '2026-05-04T23:30:00.000Z', '2026-05-04 23:30:00', '2026-06-01', '23:30:00'),
2222
('44444444-4444-4444-8444-444444444444', 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa',
23-
NULL, NULL, '2026-05-05T00:15:00Z', '2026-05-05T00:15:00', '2026-04-30', '00:15:00');
23+
NULL, NULL, '2026-05-05T00:15:00.000Z', '2026-05-05 00:15:00', '2026-04-30', '00:15:00');
2424
queries:
2525
- name: min-max-over-temporal-columns
2626
op: list

‎server/java/integration-tests-kotlin/src/test/kotlin/com/metaobjects/integration/kotlin/QueryScenarioRunner.kt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import org.jetbrains.exposed.sql.AndOp
2222
import org.jetbrains.exposed.sql.Column
2323
import org.jetbrains.exposed.sql.Database
2424
import org.jetbrains.exposed.sql.Op
25+
import org.jetbrains.exposed.sql.javatime.JavaLocalDateColumnType
2526
import org.jetbrains.exposed.sql.Query
2627
import org.jetbrains.exposed.sql.ResultRow
2728
import org.jetbrains.exposed.sql.SortOrder
@@ -680,7 +681,9 @@ object QueryScenarioRunner {
680681
type.contains("bigint") || type.contains("int8") -> (raw as? Number)?.toLong() ?: raw.toString().toLong()
681682
type.contains("int") -> (raw as? Number)?.toInt() ?: raw.toString().toInt()
682683
// A filter on a DATE column (a report's date dimension) supplies the day as text.
683-
type == "date" -> if (raw is LocalDate) raw else LocalDate.parse(raw.toString())
684+
// Keyed off the column type too: SQLite spells a DATE column's SQL type as TEXT.
685+
type == "date" || col.columnType is JavaLocalDateColumnType ->
686+
if (raw is LocalDate) raw else LocalDate.parse(raw.toString())
684687
else -> raw
685688
}
686689
}

0 commit comments

Comments
 (0)