Closed amjith closed 6 years ago
@amjith How about replacing -1
with 0
:) ?
drop table foo
returns -1
too. mycli
returns 0
on both queries.
Replacing it with zero sounds fine. I just want to understand why it returns -1. Is that a latent bug in our code or is the sqlite connector behaving badly?
Not our code's bug. sqlite3
library returns rowcount=-1
and cursor.fetchall()
returns []
empty list.
If the rowcount is unreliable from the sqlite3 library let's not use it at all. We'll just rely on our own counting to report that number.
Okay. Got it.
insert
, delete
queries return correct row count while cursor.fetchall()
returns []
. So we need to use rowcount
for those case, I think.
@amjith I pushed little fix.
Works great!
Create table results displays -1 as affected rows.