File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717for row in con .execute ("select firstname, lastname from person" ):
1818 print (row )
1919
20- # Using a dummy WHERE clause to not let SQLite take the shortcut table deletes.
21- print ("I just deleted" , con .execute ("delete from person where 1=1" ).rowcount , "rows" )
20+ print ("I just deleted" , con .execute ("delete from person" ).rowcount , "rows" )
Original file line number Diff line number Diff line change @@ -543,18 +543,17 @@ Cursor Objects
543543 attribute, the database engine's own support for the determination of "rows
544544 affected"/"rows selected" is quirky.
545545
546- For ``DELETE `` statements, SQLite reports :attr: `rowcount ` as 0 if you make a
547- ``DELETE FROM table `` without any condition.
548-
549546 For :meth: `executemany ` statements, the number of modifications are summed up
550547 into :attr: `rowcount `.
551548
552549 As required by the Python DB API Spec, the :attr: `rowcount ` attribute "is -1 in
553550 case no ``executeXX() `` has been performed on the cursor or the rowcount of the
554- last operation is not determinable by the interface".
551+ last operation is not determinable by the interface". This includes ``SELECT ``
552+ statements because we cannot determine the number of rows a query produced
553+ until all rows were fetched.
555554
556- This includes `` SELECT `` statements because we cannot determine the number of
557- rows a query produced until all rows were fetched .
555+ With SQLite versions before 3.6.5, :attr: ` rowcount ` is set to 0 if
556+ you make a `` DELETE FROM table `` without any condition .
558557
559558.. attribute :: Cursor.lastrowid
560559
Original file line number Diff line number Diff line change @@ -528,8 +528,8 @@ Extension Modules
528528Documentation
529529-------------
530530
531- - Issue #13491: Fix many errors in sqlite3 documentation. Initial
532- patch by Johannes Vogel.
531+ - Issues #13491 and #13995 : Fix many errors in sqlite3 documentation.
532+ Initial patch for #13491 by Johannes Vogel.
533533
534534- Issue #13402: Document absoluteness of sys.executable.
535535
You can’t perform that action at this time.
0 commit comments