Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print back the # of rows affected (ins, upd, del, scanned) with timings #2461

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mamcx
Copy link
Contributor

@mamcx mamcx commented Mar 13, 2025

Description of Changes

Closes #2430.

API and ABI breaking changes

It change the returning json for sql route (spacetimedb::json::client_api::StmtResultJson), with added field for stats.

Expected complexity level and risk

1

Testing

  • Added test that confirm the number of stats for ins, del, upd
  • Manual testing of the cli output using the module keynote-benchmarks
🪐quickstart>delete from position;
(0 rows) [scan: 2000000, del: 1000000, server: 3.49s, client: 3.50s]

🪐quickstart>select * from position;
 id | x | y | z
----+---+---+---
(0 rows) [server: 1.98ms, client: 9.42ms]

🪐quickstart>delete from position;
(0 rows) [server: 1.29ms, client: 8.32ms]

🪐quickstart>INSERT INTO position (id, x, y, z) VALUES (1000011, 10.0, 20.0, 30.0);
(0 rows) [ins: 1, server: 1.99ms, client: 7.02ms]

🪐quickstart>select * from position;
 id      | x  | y  | z
---------+----+----+----
 1000011 | 10 | 20 | 30
(1 row) [scan: 3, server: 1.41ms, client: 7.07ms]

🪐quickstart>update position set x = 1.0;
(0 rows) [scan: 2, upd: 1, server: 3.08ms, client: 8.96ms]

@mamcx mamcx added api-break A PR that makes an API breaking change release-1.0.1 labels Mar 13, 2025
@mamcx mamcx self-assigned this Mar 13, 2025
@bfops bfops added release-any To be landed in any release window and removed release-1.0.1 labels Mar 13, 2025
@bfops
Copy link
Collaborator

bfops commented Mar 13, 2025

I'm removing the release-1.0.1 label from this. We are trying to roll that release toda, with reviewed PRs only.

@mamcx mamcx force-pushed the mamcx/cli-show-rows-affected branch from 518f402 to a199640 Compare March 13, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break A PR that makes an API breaking change release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL - update and delete queries do not return any rows
2 participants