Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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=<v> overrides it for one build, to try a candidate engine.
ext.relixEngineVersion = (findProperty('relixEngineVersion') ?: '1.0.0-rc11') as String

def engineIsSnapshot = relixEngineVersion.endsWith('-SNAPSHOT')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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());
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
Loading