@@ -291,7 +291,9 @@ static int allow_missing_dict_bindings = 0;
291291/** .. method:: carray(object: Buffer, *, start: int = 0, stop: int = -1, flags: int = -1)
292292
293293 Indicates a Python object is being provided as a runtime array for the
294- `Carray extension <https://sqlite.org/carray.html>`__.
294+ `Carray extension <https://sqlite.org/carray.html>`__. This is useful if you
295+ need a large number of int or float available during a query, as they will
296+ be used without calling back into Python code or acquiring the GIL.
295297
296298 .. code-block:: python
297299
@@ -301,19 +303,20 @@ static int allow_missing_dict_bindings = 0;
301303 ids = array.array("l", [1, 73, 94567, 62])
302304
303305 # get records matching those ids
304- for row in con.execute("SELECT * FROM record WHERE record.id in CARRAY(?)",
306+ for row in con.execute("SELECT * FROM record WHERE record.id IN CARRAY(?)",
305307 apsw.carray(ids)):
306308 print(row)
307309
308310 :param object: Any object that implements the buffer protocol as
309311 a single contiguous binary data like :class:`bytes`, :class:`bytearray`,
310- :class:`array.array`, numpy etc.
312+ :class:`array.array`, numpy.array etc.
311313 :param start: Index of the first entry to bind
312314 :param stop: Index to stop at - ie one beyond the last entry bound. Default
313- is all remaining members. There is a limit of 2 billion.
315+ is all remaining members. There is a limit of 2 billion, and a minimum
316+ of 1.
314317 :param flags: Indicates if the data is 32/64 bit int, or 64 bit double (floating point).
315- If not supplied then the buffer format is examined and accepted if native byte order .
316- You can see the `format string <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`
318+ If not supplied then the buffer format is detected .
319+ You can see the `format string <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`__
317320 with :code:`memoryview(object).format`. Alternately provide a :data:`constant <apsw.mapping_carray>`
318321 like :code:`apsw.SQLITE_CARRAY_INT32`
319322
0 commit comments