Skip to content

Allow for multiple database connections in the same request #121

Closed
@jsarchibald

Description

@jsarchibald

Issue when a user has two or more databases -- say, test1.db and test2.db -- that they try to use in the same request. The way the library currently works, whichever database I execute on first in this request will be the only database I'm allowed to connect to in the request. So if I try test1.execute(...) followed by test2.execute(...) in the same request, I'm not going to get what I wanted, since the library limits us to one database connection per request -- in this case, the library will try to execute my second SQL statement on test1.db. And that's because of the request global flask.g._connection we're setting, and then using as a gatekeeper against opening new connections.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions