I'm reflecting a table into the ORM, that has no defined unique key, but has two fields that when combined are unique - it's MySQL, but that shouldn't matter.

Eg:

int userID and int groupId are non-unique, but when combined they are.


Can anyone point me at a simple example of how to do it? Everything I've found by searching has been a complex example, I just want to have the table reflected into SQLAlchemy, it's only ever going to be read-only.

out of curiosity, is there a simple way to reflect an entire database, or do you always need to set up classes for each table?

Thank you!

Carl

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/4df20db5-6333-9971-00f7-e9a490bfc2ea%40bl.echidna.id.au.

Reply via email to