librelist archives

« back to archive

Single Site with Multiple, Separate Database Connections

Single Site with Multiple, Separate Database Connections

From:
Gary Chambers
Date:
2013-07-10 @ 01:53
All,

I'm trying to migrate to Flask an existing web site that uses multiple, 
separate database connections.  I'm having trouble determining how to 
accomplish this within this single site, though.  Is there a Flask pattern
for such a site?  Thank you in advance.

--
G.

Re: [flask] Single Site with Multiple, Separate Database Connections

From:
David Van Duzer
Date:
2013-07-10 @ 02:06
http://pythonhosted.org/Flask-SQLAlchemy/binds.html

On Tue, Jul 9, 2013 at 7:53 PM, Gary Chambers <gwchamb@gwcmail.com> wrote:
> All,
>
> I'm trying to migrate to Flask an existing web site that uses multiple, 
separate database connections.  I'm having trouble determining how to 
accomplish this within this single site, though.  Is there a Flask pattern
for such a site?  Thank you in advance.
>
> --
> G.

Re: [flask] Single Site with Multiple, Separate Database Connections

From:
Gary Chambers
Date:
2013-07-10 @ 04:07
David,

> http://pythonhosted.org/Flask-SQLAlchemy/binds.html

Thank you.  I haven't been interested in using SQLAlchemy, but I'll take a
look at it.

--
G.

Re: [flask] Single Site with Multiple, Separate Database Connections

From:
David Van Duzer
Date:
2013-07-10 @ 04:15
It's worth nothing that SQL Alchemy advertises two main functions. You can
skip the ORM (as many do) and just use the Core for exactly the sort of 
thing you're needing.

> On Jul 9, 2013, at 22:07, Gary Chambers <gwchamb@gwcmail.com> wrote:
> 
> David,
> 
>> http://pythonhosted.org/Flask-SQLAlchemy/binds.html
> 
> Thank you.  I haven't been interested in using SQLAlchemy, but I'll take
a look at it.
> 
> --
> G.

Re: [flask] Single Site with Multiple, Separate Database Connections

From:
Gary Chambers
Date:
2013-07-10 @ 13:59
David,

> It's worth nothing that SQL Alchemy advertises two main functions. You can
> skip the ORM (as many do) and just use the Core for exactly the sort of
> thing you're needing.

Thank you for pointing that out.  Am I misunderstanding its implementation,
or must I duplicate the database schema with SA?  It appears that, from what
I've read of the SQLAlchemy docs, it's possible to send the textual versions
of database queries with SA, but there are disadvantages to doing so.  All
of the so-called business logic of my site/applications is in the database
and extracted by function calls.

Thank you again.

--
G.