Skip to content

Row JSON now returns {"row": {...}} - #3071

Merged
simonw merged 3 commits into
mainfrom
row-json-row-key
Nov 15, 2026
Merged

simonw merged 3 commits into
mainfrom
row-json-row-key

Conversation

@simonw

@simonw simonw commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

/database/table/pk.json returned the row as the only item in a "rows" list. It now returns it as an object in a "row" key:

{
  "ok": true,
  "database": "fixtures",
  "table": "simple_primary_key",
  "primary_keys": ["id"],
  "primary_key_values": ["1"],
  "query_ms": 1.2,
  "row": {"id": 1, "content": "hello"}
}

This is a breaking change to the JSON API.

Claude Fable 5.2 Medium

It replaces the row shape part of #2986, re-implemented against the new json_renderer(). The infinity fix from that PR is not included here.

What changes

  • The default row response has "row" in place of "rows".
  • "truncated" is no longer in that response. It was always false.
  • ?_extra=render_cell returns a single object keyed by column name, in place of a list containing one object.
  • Any ?_shape= option returns the same shapes as table JSON, so ?_shape=objects gives the previous format, including "truncated" and render_cell as a list.
  • Error responses are unchanged.
  • Output renderer plugins are unaffected: they are still passed a rows list containing the one row.
  • The row edit dialog in edit-tools.js reads data.row.

Docs

  • New "Rows" section in docs/json_api.rst.
  • Upgrade guide entry and changelog entry.
  • The render_cell extra example for row pages, regenerated with cog.

Testing

  • Full non-browser suite passes locally (3171 passed, plus 41 serial).
  • The five row edit Playwright tests pass in Chromium. The rest of the Playwright suite was not run locally.

Closes #2612, closes #2137

🤖 Generated with Claude Code

/database/table/pk.json previously returned the row as the only item in
a "rows" list. It now returns it as an object in a "row" key.

Two other keys change to match: "truncated" is no longer included, since
a single row lookup cannot be truncated, and the render_cell extra is a
single object keyed by column name instead of a list of one.

Any ?_shape= option returns the same shapes as table JSON, so
?_shape=objects gives the previous format. Output renderer plugins are
still passed a rows list containing the one row.

The row edit dialog reads the new shape.

Closes #2612, closes #2137

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (2d5e496) to head (23e959a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datasette/renderer.py 0.00% 8 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3071   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         80      80           
  Lines      13999   14006    +7     
=====================================
- Misses     13999   14006    +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@simonw
simonw merged commit 8b529de into main Nov 15, 2026
7 of 13 checks passed
@simonw
simonw deleted the row-json-row-key branch November 15, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvements to /db/table/pk.json row page Redesign row default JSON

1 participant