All samples for the ORM part use a session to connect to the database, 
whereas all samples in the Core part use a connection. If I use both 
approaches in my app, does it make sense to execute the SQL Expression 
Language (Core) through session.execute() or is there a reason I should use 
connection.execute()?

For example, can I say:

from sqlalchemy.sql import select
from models import User
from main import session_scope

users = User.__table__

with session_scope() as session:
    result = session.execute(select([users]))


session_scope() is a context manager as described 
here<http://docs.sqlalchemy.org/en/latest/orm/session.html?highlight=session_scope#session-frequently-asked-questions>
.


-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to