Skip to content

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
  • Added unit test for the output of the sql cli with and without stats
  • Manual testing of the cli output using the module keynote-benchmarks
🪐quickstart>delete from position;
(0 rows) [deleted: 1000000, server: 3.71s]
Roundtrip time: 3.72s

🪐quickstart>select * from position;
 id | x | y | z
----+---+---+---
(0 rows) [server: 1.32ms]
Roundtrip time: 6.46ms

🪐quickstart>delete from position;
(0 rows) [server: 1.47ms]
Roundtrip time: 7.69ms

🪐quickstart>INSERT INTO position (id, x, y, z) VALUES (1000011, 10.0, 20.0, 30.0);
(0 rows) [inserted: 1, server: 2.82ms]
Roundtrip time: 7.13ms

🪐quickstart>select * from position;
 id      | x  | y  | z
---------+----+----+----
 1000011 | 10 | 20 | 30
(1 row) [server: 1.29ms]
Roundtrip time: 5.49ms

🪐quickstart>update position set x = 1.0;
(0 rows) [updated: 1, server: 1.96ms]
Roundtrip time: 4.50ms

@mamcx mamcx added release-any To be landed in any release window api-break A PR that makes an API breaking change labels Mar 13, 2025
@mamcx mamcx self-assigned this Mar 13, 2025
@mamcx mamcx force-pushed the mamcx/cli-show-rows-affected branch from afe71d0 to 756a8ee Compare March 19, 2025 18:15
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the files that I am a codeowner for:

crates/cli/src/api.rs
crates/cli/src/subcommands/sql.rs

Copy link
Collaborator

@joshua-spacetime joshua-spacetime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add a smoke test as well?

@bfops
Copy link
Collaborator

bfops commented Mar 24, 2025

Wait, is this a breaking change? We just added a field, is that right? If it's really a breaking change, we can't release it.

@joshua-spacetime
Copy link
Collaborator

That's correct, this just adds a field, and so it's not a breaking change. I believe the label was added by mistake @mamcx?

@mamcx mamcx force-pushed the mamcx/cli-show-rows-affected branch 2 times, most recently from 5349346 to f4ef4b2 Compare March 24, 2025 17:17
@mamcx
Copy link
Contributor Author

mamcx commented Mar 26, 2025

That's correct, this just adds a field, and so it's not a breaking change. I believe the label was added by mistake @mamcx?

Yeah, I put the label before adding the serde optionality.

@mamcx mamcx removed the api-break A PR that makes an API breaking change label Mar 26, 2025
@mamcx mamcx changed the title Print back the # of rows affected (ins, upd, del, scanned) with timings Print back the # of rows affected (ins, upd, del) with timings Mar 27, 2025
mamcx and others added 3 commits March 28, 2025 08:53
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
@mamcx mamcx force-pushed the mamcx/cli-show-rows-affected branch from f4ef4b2 to 067f660 Compare March 28, 2025 16:08
@mamcx mamcx added this pull request to the merge queue Mar 28, 2025
Merged via the queue into master with commit 98395ca Mar 28, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

5 participants