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

CLI - Fix: SQL update and delete are throwing exceptions #2358

Open
bfops opened this issue Mar 6, 2025 · 4 comments · May be fixed by #2359
Open

CLI - Fix: SQL update and delete are throwing exceptions #2358

bfops opened this issue Mar 6, 2025 · 4 comments · May be fixed by #2359
Assignees

Comments

@bfops
Copy link
Collaborator

bfops commented Mar 6, 2025

It seems like any update and delete query in spacetime sql will cause the CLI to throw an exception.

The updates do go through, but the CLI crashes.

@bfops bfops self-assigned this Mar 6, 2025
@bfops
Copy link
Collaborator Author

bfops commented Mar 6, 2025

This only happens in the interactive view. The queries succeed without complaint when they're provided on the command line.

@bfops
Copy link
Collaborator Author

bfops commented Mar 6, 2025

This seems to be due to passing with_stats: true to run_sql. If I change it to false, we do not see this issue.

@bfops
Copy link
Collaborator Author

bfops commented Mar 6, 2025

It seems to be down to the table.with line in run_sql here:

                // The `tabled::count_rows` add the header as a row, so subtract it.
                let row_count = print_row_count(table.count_rows().wrapping_sub(1));
                table.with(tabled::settings::panel::Footer::new(row_count));

This is from the api module, which I don't have any context on.

Edit: Nope I didn't read carefully. The table is a tabled::Table.

@bfops
Copy link
Collaborator Author

bfops commented Mar 6, 2025

I believe this is down to the row_count being zero.

@bfops bfops linked a pull request Mar 6, 2025 that will close this issue
1 task
@bfops bfops linked a pull request Mar 6, 2025 that will close this issue
1 task
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 a pull request may close this issue.

1 participant