[docs] [issue29725] sqlite3.Cursor doesn't properly document "arraysize"
Aviv Palivoda
report at bugs.python.org
Fri Mar 31 11:10:42 EDT 2017
Aviv Palivoda added the comment:
Hi Cheryl, the arraysize value can be set by doing:
>>> cursor.array = 5
For example I can do the following
>>> import sqlite3
>>> s = sqlite3.connect(":memory:")
>>> s.execute("create table a(a,b)")
>>> s.execute("insert into a(a,b) values (1,2)")
>>> s.execute("insert into a(a,b) values (3,4)")
>>> c = s.cursor() # Array size is 1
>>> c.execute("select * from a")
>>> c.fetchmany()
[(1, 2)]
>>> c.fetchmany()
[(3, 4)]
>>> c.arraysize = 2 # Change array size
>>> c.fetchmany()
[(1, 2), (3, 4)]
As you can see the arraysize set the number of results the fetchmany will return.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29725>
_______________________________________
More information about the docs
mailing list