Fixing bug

Fixing bug where the insert method always returns 0,
even after a successfully insetion, rather than the id
of the inserted element.
This commit is contained in:
Diego Guimarães 2013-11-14 22:24:44 -02:00
parent 4856c16b1f
commit bc16b9e325

View File

@ -68,7 +68,7 @@ class Table(object):
if ensure:
self._ensure_columns(row, types=types)
res = self.database.executable.execute(self.table.insert(row))
return res.lastrowid
return res.inserted_primary_key[0]
def insert_many(self, rows, chunk_size=1000, ensure=True, types={}):
"""