default handling of sqlite doesnt work with string pk cols

Issue #603 resolved
Mike Bayer repo owner created an issue
from sqlalchemy import *

engine = create_engine('sqlite:///')

meta = BoundMetaData(engine)

test_table = Table(
    'test', meta,
    Column('uuid', String, primary_key=True),
    )
test_table.create()

r = test_table.insert().execute(uuid='hi')
print r.last_inserted_ids()
assert r.last_inserted_ids() == ['hi']('hi')

its sticking cursor.lastrowid in there, which unfortunately with sqlite becomes the oid of the row not the PK col, and is completely inconsistent with its handling for integer primary keys. obviously this raises ORM issues.

def. need a unit test for this and need to test on mysql as well.

Comments (1)

  1. Log in to comment