Skip to content

feat(rds-data): typed-result fidelity for rich column types (batch 3)#2010

Merged
vieiralucas merged 1 commit into
mainfrom
wt-rdsdata-3
Jun 27, 2026
Merged

feat(rds-data): typed-result fidelity for rich column types (batch 3)#2010
vieiralucas merged 1 commit into
mainfrom
wt-rdsdata-3

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jun 27, 2026

Copy link
Copy Markdown
Member

Batch 3 of the RDS Data API (rds-data). Closes the typed-result gap for non-scalar column types.

Problem

ExecuteStatement decoded BOOL/INT/FLOAT/BYTEA/text correctly, but every other Postgres column (NUMERIC, TIMESTAMP, TIMESTAMPTZ, DATE, TIME, UUID, JSON/JSONB) fell through to the String decode arm. Those columns use a binary wire format that does not decode as String, so try_get failed and the field was silently reported as isNull — a real value disappearing from the result set.

Fix

  • Postgres: decode NUMERIC (rust_decimal::Decimal), TIMESTAMP/TIMESTAMPTZ/DATE/TIME (chrono), UUID (uuid), JSON/JSONB (serde_json::Value) and render each as AWS stringValue. Timestamps use Postgres's own canonical text (fractional seconds only when present, trailing zeros trimmed).
  • MySQL: format Date/Time protocol values as canonical SQL text instead of the Rust debug form.
  • tokio-postgres gains with-chrono-0_4 / with-uuid-1 / with-serde_json-1; adds rust_decimal (db-tokio-postgres).

Tests

New Docker-gated e2e (rds_data_api_decodes_rich_column_types): inserts NUMERIC/TIMESTAMP/UUID/JSONB and asserts each comes back as the expected stringValue against a real Postgres container. Passes locally; the existing typed-param and transaction tests still pass.

Builds clean; clippy --all-targets -D warnings clean; fmt clean.


Summary by cubic

Fixes typed-result gaps in rds-data ExecuteStatement by correctly decoding Postgres NUMERIC/TIMESTAMP/TIMESTAMPTZ/DATE/TIME/UUID/JSON(B) to AWS stringValue, and by rendering MySQL DATE/DATETIME/TIME as canonical SQL text. Prevents real values from collapsing to isNull and improves result fidelity.

  • Bug Fixes

    • Postgres: decode via rust_decimal, chrono, uuid, and serde_json; timestamps use Postgres-style text with trimmed fractional seconds and timezone for TIMESTAMPTZ.
    • MySQL: output canonical SQL text for DATE/DATETIME/TIME (includes sign and microseconds) instead of Rust debug forms.
    • Removes the fallback String decode path that caused binary columns to return isNull.
  • Dependencies

    • Enable tokio-postgres features: with-chrono-0_4, with-uuid-1, with-serde_json-1.
    • Add rust_decimal (feature db-tokio-postgres), plus chrono and uuid.

Written for commit 174f676. Summary will update on new commits.

Review in cubic

ExecuteStatement now decodes Postgres NUMERIC, TIMESTAMP, TIMESTAMPTZ,
DATE, TIME, UUID and JSON/JSONB columns into AWS `stringValue` fields,
and MySQL DATE/DATETIME/TIME values into their canonical SQL text.

Before this, those binary-format Postgres columns hit the fallback
`String` decode, which fails for them and wrongly reported `isNull` — so
a perfectly good numeric/timestamp/uuid/json value vanished from the
result. tokio-postgres gains the with-chrono/with-uuid/with-serde_json
features plus rust_decimal so the real values decode; timestamps render
with Postgres's own trailing-zero-trimmed fractional-seconds rule.

E2E test inserts NUMERIC/TIMESTAMP/UUID/JSONB and asserts each returns
the expected stringValue against a real Postgres container.
@vieiralucas vieiralucas merged commit dae9328 into main Jun 27, 2026
104 checks passed
@vieiralucas vieiralucas deleted the wt-rdsdata-3 branch June 27, 2026 21:57
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.

1 participant