I realize that the orm really wants/needs a table to have a primary key: http://docs.sqlalchemy.org/en/rel_1_1/faq/ormconfiguration.html?#how-do-i-map-a-table-that-has-no-primary-key
Alas I have to deal with an existing table with no primary key. That said, it does have a unique constraint on a subset of the columns, though some of them are nullable (and indeed contain nulls). I've set up a declarative model with these columns labeled as primary_key=True, and things seem to work... until they don't, e.g. when calling delete() on some objects followed by flush(): sqlalchemy.orm.exc.FlushError: Can't delete from table MY_SCHEMA.my_table using NULL for primary key value on column my_table.MY_COLUMN_1 I know this is a long shot, but is there any way to tell the orm not to be such a stickler for detail, and just go ahead and emit the sql? I dread not being able to use the orm... -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.