From 117cc3162c72e25b2f39a8d8e93752bdb0926e6a Mon Sep 17 00:00:00 2001 From: David Tooke Date: Fri, 16 Oct 2026 15:41:09 -0400 Subject: [PATCH 1/2] Build against the engine candidate, and render a TIMESTAMPTZ as JSON The engine gains a zoned timestamp, so OutputFormat's exhaustive switch over values needs its case; it renders as its ISO-8601 text, offset kept, like the other temporals. The engine pin now takes -PrelixEngineVersion, as relix-mcp's and the front ends' do, so a candidate engine can be tried without an edit. --- build.gradle | 3 ++- .../relix/cli/render/OutputFormat.java | 2 ++ .../relix/cli/render/OutputFormatTest.java | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 67fbfdc..3410b83 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,8 @@ version = findProperty('cliVersion') ?: '0.1.0-SNAPSHOT' // command needs engine work that is not yet released, it tracks the engine's own develop // branch instead (1.0.0-SNAPSHOT), which relix-core publishes to Central's snapshot // repository on every push. A release pins a released engine (checkEnginePin). -ext.relixEngineVersion = '1.0.0-rc9' +// -PrelixEngineVersion= overrides it for one build, to try a candidate engine. +ext.relixEngineVersion = (findProperty('relixEngineVersion') ?: '1.0.0-SNAPSHOT') as String def engineIsSnapshot = relixEngineVersion.endsWith('-SNAPSHOT') diff --git a/src/main/java/com/darkcollective/relix/cli/render/OutputFormat.java b/src/main/java/com/darkcollective/relix/cli/render/OutputFormat.java index df25036..2e549a0 100644 --- a/src/main/java/com/darkcollective/relix/cli/render/OutputFormat.java +++ b/src/main/java/com/darkcollective/relix/cli/render/OutputFormat.java @@ -27,6 +27,7 @@ import com.darkcollective.relix.value.TimeValue; import com.darkcollective.relix.value.TimestampValue; import com.darkcollective.relix.value.Value; +import com.darkcollective.relix.value.ZonedTimestampValue; import com.darkcollective.relix.symbol.ColumnDefinition; import com.darkcollective.relix.symbol.Schema; @@ -442,6 +443,7 @@ public static String jsonValue(Value value) { case DateValue d -> JsonText.quote(d.asDisplayString()); case TimeValue t -> JsonText.quote(t.asDisplayString()); case TimestampValue ts -> JsonText.quote(ts.asDisplayString()); + case ZonedTimestampValue z -> JsonText.quote(z.asDisplayString()); case DurationValue du -> JsonText.quote(du.asDisplayString()); }; } diff --git a/src/test/java/com/darkcollective/relix/cli/render/OutputFormatTest.java b/src/test/java/com/darkcollective/relix/cli/render/OutputFormatTest.java index 04a234d..2bd1eca 100644 --- a/src/test/java/com/darkcollective/relix/cli/render/OutputFormatTest.java +++ b/src/test/java/com/darkcollective/relix/cli/render/OutputFormatTest.java @@ -27,6 +27,7 @@ import com.darkcollective.relix.value.TimeValue; import com.darkcollective.relix.value.TimestampValue; import com.darkcollective.relix.value.Value; +import com.darkcollective.relix.value.ZonedTimestampValue; import com.darkcollective.relix.symbol.ColumnDefinition; import com.darkcollective.relix.symbol.ScalarType; import com.darkcollective.relix.symbol.Schema; @@ -368,6 +369,17 @@ void booleansAndNull() { assertThat(out).contains("{\"flag\":true,\"note\":null}"); } + @Test + @DisplayName("renders a zoned timestamp as an ISO string that keeps its offset") + void zonedTimestamp() { + Schema schema = new Schema(List.of(new ColumnDefinition("at", ScalarType.TIMESTAMPTZ))); + String out = render(OutputFormat.JSON, schema, List.of(row(schema, + new ZonedTimestampValue(java.time.OffsetDateTime.parse("2026-03-01T09:00:00+02:00"))))); + + assertThat(out).contains("{\"at\":\"2026-03-01T09:00") + .contains("+02:00\"}"); + } + @Test @DisplayName("renders nested struct and array values as native JSON") void nestedValues() { From b48d2fc585c42671e60aed0e58b0d41165590b98 Mon Sep 17 00:00:00 2001 From: David Tooke Date: Fri, 16 Oct 2026 16:06:04 -0400 Subject: [PATCH 2/2] Pin the engine at 1.0.0-rc11 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3410b83..7f4dbea 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ version = findProperty('cliVersion') ?: '0.1.0-SNAPSHOT' // branch instead (1.0.0-SNAPSHOT), which relix-core publishes to Central's snapshot // repository on every push. A release pins a released engine (checkEnginePin). // -PrelixEngineVersion= overrides it for one build, to try a candidate engine. -ext.relixEngineVersion = (findProperty('relixEngineVersion') ?: '1.0.0-SNAPSHOT') as String +ext.relixEngineVersion = (findProperty('relixEngineVersion') ?: '1.0.0-rc11') as String def engineIsSnapshot = relixEngineVersion.endsWith('-SNAPSHOT')