Skip to content

Render arrays correctly in SQL#5377

Open
clockwork-labs-bot wants to merge 1 commit into
masterfrom
bot/render-sql-arrays
Open

Render arrays correctly in SQL#5377
clockwork-labs-bot wants to merge 1 commit into
masterfrom
bot/render-sql-arrays

Conversation

@clockwork-labs-bot

Copy link
Copy Markdown
Contributor

Description of Changes

Fixes #4825.

Reimplements the array SQL rendering fix from stale PR #3945 on current master.

The change adds a typed array serialization hook so SQL formatters can render arrays as one value instead of streaming each element independently. spacetime sql now renders non-byte arrays with array delimiters, while array<u8> keeps the existing byte output. The PostgreSQL row encoder now emits primitive arrays as native PG arrays and nested/complex arrays as JSON array fields.

API and ABI breaking changes

None.

Expected complexity level and risk

This touches shared SATS formatting, but the new hook preserves the previous default array serialization path and is only overridden by SQL-specific formatters.

Testing

  • RUSTC=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin/rustc /Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin/cargo test -p spacetimedb-cli output_arrays --lib
  • LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 RUSTC=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin/rustc /Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin/cargo test -p spacetimedb-pg encoder::tests --lib
  • LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 RUSTC=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin/rustc /Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin/cargo test -p spacetimedb-sats --lib
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render arrays correctly in SQL

1 participant