Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow DB to be passed as an argument to models #16

Open
weavejester opened this issue May 28, 2017 · 3 comments
Open

Allow DB to be passed as an argument to models #16

weavejester opened this issue May 28, 2017 · 3 comments

Comments

@weavejester
Copy link

Can the database be passed as an argument to the models, or does Toucan only support the database connection as a global var?

@camsaul
Copy link
Member

camsaul commented May 31, 2017

currently it only supports the global var but you can bind *db-connection* if you want to use a different database.

it does sound like it could be a useful feature to have, however, so I'll edit the title of this issue accordingly

@camsaul camsaul changed the title Can the DB be passed as an argument? Allow DB to be passed as an argument to models May 31, 2017
@camsaul
Copy link
Member

camsaul commented May 31, 2017

this will likely require reworking things a bit since the internal Toucan DB functions all call (db-connection) to get a connection to the current DB

@beders
Copy link

beders commented Jul 17, 2018

I would even go further and separate out the query forming and query execution aspect.
This way we could use async DB drivers, since JDBC is not scaling well.
A bootstrap function could provide functions that either deliver actual results or futures, depending on the DB drivers used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants