-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09/10/11 11:24, Tim Streater wrote:
> But closer investigation of the SQLite3 interface does not reveal an
> equivalent to the FetchAll method available under PDO.
Note that SQLite itself (the C library) doesn't have it either. You call
prepare on SQL text and then step which will provide the next result row.
SQLite *only* calculates the next result row on a call to step, not all
of the result rows.
Any sort of interface that is telling you in advance the number of result
rows is actually making SQLite do all the work of finding all the results.
It is in no way more memory or CPU efficient.
If you really want a fetchall you can write itself ala this pseudocode:
results=list()
while result=next_result():
results.append(result)
Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAk6R6NwACgkQmOOfHg372QTjBgCgqTqnHG+8ny7Utu4+6/2hwMHg
BQ8AniRWi3LmFmh0pD8Zbvi1EZp8x6Uq
=lHWO
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users