On Dec 16, 2011, at 3:55 PM, Vlad K. wrote: > > Hi all! > > I have a few scenarios here that I believe are best solved without the ORM > overhead. For example, various log tables that do not require a primary key, > the rows are practically immutable, but are queried back for statistical > analysis. It is my understanding that I cannot use the ORM without a primary > key of some kind? > > I am looking through the docs and I believe I should look into SQL Expression > Language section for that, am I correct? Which basically means I should be > using the expressions directly on the connection object > (connection.execute()) instead of using the sqlalchemy.orm.scoped_session > object?
If your dealings with data are already framed by a Session, you can work with the SQL expression language in that context using either Session.execute() or work with the Connection that's part of the current transactional scope by calling Session.connection() to get at it. This essentially maintains the usage of Session as your transaction management object, you just aren't using the object-relational aspects of it. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.