SQLite Forum

Do not auto reset after schema change
Login
The proof is in the pudding:

```
>python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import apsw
>>> db = apsw.Connection()
>>> db.execute('create table x(x)')
<newapsw.Cursor object at 0x000001C993FA3340>
>>> db.execute('insert into x select value from wholenumber where value between 1 and 10');
<newapsw.Cursor object at 0x000001C996656100>
>>> for row in db.execute('select * from x'):
...  print(row)
...
Row(x=1)
Row(x=2)
Row(x=3)
Row(x=4)
Row(x=5)
Row(x=6)
Row(x=7)
Row(x=8)
Row(x=9)
Row(x=10)
>>> cr = db.execute('select * from x')
>>> next(cr)
Row(x=1)
>>> next(cr)
Row(x=2)
>>> db.execute('alter table x rename to y')
<newapsw.Cursor object at 0x000001C996656100>
>>> next(cr)
Row(x=3)
>>> cr2 = db.execute('select * from y')
>>> next(cr2)
Row(x=1)
>>> next(cr2)
Row(x=2)
>>> db.execute('alter table y add column z')
<newapsw.Cursor object at 0x000001C996656220>
>>> next(cr)
Row(x=4)
>>> next(cr2)
Row(x=3)
>>> cr3 = db.execute('select * from y')
>>> next(cr)
Row(x=5)
>>> next(cr2)
Row(x=4)
>>> next(cr3)
Row(x=1, z=None)
>>> next(cr3)
Row(x=2, z=None)
>>> db.execute('alter table y rename x to y')
<newapsw.Cursor object at 0x000001C996656280>
>>> next(cr)
Row(x=6)
>>> next(cr2)
Row(x=5)
>>> next(cr3)
Row(x=3, z=None)
>>> cr4 = db.execute('select * from y')
>>> next(cr4)
Row(y=1, z=None)
>>> next(cr)
Row(x=7)
>>>
```