Am 12.10.2010 17:10, schrieb Roy Smith:

> [A]re there any plans to update the api to allow an iterable instead of
> a sequence?

sqlite3 (standard library, python 2.6.6., Windows 32Bit) does that already::

import sqlite3 as sql

connection = sql.connect(":memory:")

cursor = connection.execute("""
    CREATE TABLE test (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
    text TEXT)
    ;""")
connection.commit()
cursor.executemany("""
    INSERT INTO test (text) VALUES ( ? );
    """,
    # A generator expression - delivers one row at a time
    ( ("hello nr %03d!" % i,) for i in xrange(100)))
connection.commit()
cursor.execute("SELECT * FROM test")

for id_, text in cursor.fetchall():
    print text, id_
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to