nameko-sqlalchemy and autoload

45 views
Skip to first unread message

Chris Platts

unread,
Jul 24, 2018, 6:18:58 AM7/24/18
to nameko-dev
Hi,

Pretty sure this is an easy one, but I've gone code-blind...

I'm trying to connect nameko-sqlalchemy to an existing database, and so am trying out sqlalchemy's autoload feature.  My first attempts have resulted in the error:

No engine is bound to this Table's MetaData. Pass an engine to the Table via autoload_with=<someengine>, or associate the MetaData with an engine via metadata.bind=<someengine>


... which I get.  I understand what it's telling me, but I'm trying to figure out how to do this within the structure of the nameko-sqlalchemy provider.



Could anyone point me in the right direction?

Thanks,
Chris
Message has been deleted

Chris Platts

unread,
Jul 24, 2018, 11:28:06 AM7/24/18
to nameko-dev
And as an aside, what's the suggested method for calling a sproc when using nameko-sqlalchemy?

I've found I can reach 'execute' via self.db.session.bind.execute(...) but perhaps there's a cleaner way?

Thanks!
Chris

Matt Yule-Bennett

unread,
Jul 27, 2018, 3:19:32 PM7/27/18
to nameko-dev
Hi Chris,

I've never used to auto-reload feature. It's possible it doesn't work with the structure of nameko-sqlalchemy, although I'd be surprised. Hard to say just from the error. Can you post more code?

Re: stored procedures, I'm not sure there is an established way. With self.db.session.bind.execute() are you using the newer "Database" DP or the older "DatabaseSession" one?

Matt.
Reply all
Reply to author
Forward
0 new messages