Cursor is a cursor. Only when the cursor performs addition, deletion and modification operations, can the value of the auto-increment field of the last operation be obtained through cursor.lastrowid.
When the cursor performs a search operation, cursor.lastrowid can only get None, which is empty.
When the cursor does not execute any sql and directly obtains the lastrowid, an exception will be thrown and an error will be reported!