Re: [sqlalchemy] Session's dialect's server_version_info may be None? (Execution order dependency)

2018-02-21 Thread Mike Bayer
it's not unheard of that people sometimes do a quick ping, like : engine = create_engine(...) engine.scalar("select 1") just to get it connected and initialized with server information. On Wed, Feb 21, 2018 at 6:26 AM, wrote: > Simon, thank you for the reference! That makes sense… > > Jens >

Re: [sqlalchemy] Session's dialect's server_version_info may be None? (Execution order dependency)

2018-02-21 Thread jens . troeger
Simon, thank you for the reference! That makes sense… Jens On Wednesday, February 21, 2018 at 7:15:20 PM UTC+10, Simon King wrote: > > SQLAlchemy doesn't connect to the database until it needs to. Creating > a Session by itself does not cause it to connect. This is mentioned in > the docs: >

Re: [sqlalchemy] Session's dialect's server_version_info may be None? (Execution order dependency)

2018-02-21 Thread Simon King
On Wed, Feb 21, 2018 at 6:14 AM, wrote: > Hello, > Suppose I create a db session the normal way: > engine = engine_from_config({"sqlalchemy.url":"mysql+pymysql://…"}) Session = sessionmaker(bind=engine) session = Session() > > I noticed that there is now an order dependency between

[sqlalchemy] Session's dialect's server_version_info may be None? (Execution order dependency)

2018-02-20 Thread jens . troeger
Hello, Suppose I create a db session the normal way: >>> engine = engine_from_config({"sqlalchemy.url":"mysql+pymysql://…"}) >>> Session = sessionmaker(bind=engine) >>> session = Session() I noticed that there is now an order dependency between: >>> session.bind.dialect.server_version_info # No