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

Don't display rows affected when the connector tells us -1 #204

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

dhashe
Copy link

@dhashe dhashe commented Jan 28, 2025

Description

We have been displaying "0 rows affected" in this case, but that is
misleading for CTEs, which could affect any number of rows.

Fixes #203

Manual Testing

(venv) dhashe@Aurelius litecli $ litecli -D :memory:
LiteCli: 1.14.3.dev1+geedfef6 (SQLite: 3.37.2)
GitHub: https://github.com/dbcli/litecli
:memory:> create table data (
              id INTEGER PRIMARY KEY
          );
Query OK
Time: 0.001s
:memory:> with temp as (
              select 1 as id
          )
          insert into data select id from temp;
Query OK
Time: 0.001s
:memory:> select * from data;
+----+
| id |
+----+
| 1  |
+----+
1 row in set
Time: 0.017s
:memory:> update data set id = 2;
Query OK, 1 row affected
Time: 0.001s
:memory:> insert into data (id) values (3), (4);
Query OK, 2 rows affected
Time: 0.001s
:memory:>

Checklist

  • I've added this contribution to the CHANGELOG.md file.

David Hashe added 2 commits January 28, 2025 16:00
We have been displaying "0 rows affected" in this case, but that is
misleading for CTEs, which could affect any number of rows.
@amjith
Copy link
Member

amjith commented Jan 29, 2025

Thank you for the contribution. I appreciate you taking the time to fix it. 🍦

I noticed in your original issue you #203 you invoke litecli with the -D option. That might be redundant. You can do litecli :memory: which is the same as using the -D option.

@amjith amjith merged commit fb981ba into dbcli:main Jan 29, 2025
7 checks passed
@dhashe dhashe deleted the fix-rows-affected branch January 29, 2025 15:33
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 this pull request may close these issues.

Misleading "0 rows affected" status for CTEs
2 participants