Skip to content

Conversation

@bfops
Copy link
Collaborator

@bfops bfops commented Mar 6, 2025

Description of Changes

See #2358 for more context on this issue and why this was needed.

I think we recently removed the functionality where we return row counts for update and delete statements. This means that the CLI can no longer say things like "N rows updated".

API and ABI breaking changes

No.

Expected complexity level and risk

1

Testing

  • No longer crashes when running update or delete commands in interactive mode:
$ "$WORK"/SpacetimeDBPrivate/public/target/debug/spacetimedb-cli sql -s local test-project --interactive
WARNING: This command is UNSTABLE and subject to breaking changes.

┌──────────────────────────────────────────────────────────┐
│ .exit: Exit the REPL                                     │
│ .clear: Clear the Screen                                 │
│                                                          │
│ Give us feedback in our Discord server:                  │
│    https://discord.gg/w2DVqNZXdN                         │
└──────────────────────────────────────────────────────────┘
🪐test-project>update person set name='foo'

Time: 1.28ms
🪐test-project>delete from person

Time: 1.34ms
🪐test-project>

@bfops bfops marked this pull request as ready for review March 6, 2025 17:11
@bfops bfops linked an issue Mar 6, 2025 that may be closed by this pull request
@bfops bfops requested a review from jdetter March 7, 2025 17:32
@bfops bfops linked an issue Mar 10, 2025 that may be closed by this pull request
@bfops bfops added release-any To be landed in any release window CLI only This change only affects the CLI behavior release-1.0.1 backward-compatible and removed release-any To be landed in any release window labels Mar 10, 2025
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

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

This fixes the crash so let's get this out for 1.0.1 - IMO it's really bad UX that we don't print the amount of rows changed I think that's super basic functionality which is something we can address in a future release.

@bfops bfops added this pull request to the merge queue Mar 11, 2025
Merged via the queue into master with commit ba971ae Mar 11, 2025
19 checks passed
@bfops bfops deleted the bfops/fix-sql-break branch April 9, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backward-compatible CLI only This change only affects the CLI behavior release-1.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI panics on UPDATE ... SET query CLI - Fix: SQL update and delete are throwing exceptions

3 participants