-
Notifications
You must be signed in to change notification settings - Fork 45
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
Dependency on Flask-SQLAlchemy #9
Comments
I've determined that the exact spots that depend on Flask-SQLAlchemy objects are:
And:
This conflicts with the documentation, which states that "the _db fixture should expose access to a valid SQLAlchemy Session object that can interact with your database", implying that any valid SQLAlchemy Session object will do. In fact, only those which have an The documentation should be updated to reflect the fact that this project does not support arbitrary SQLAlchemy Session objects. Additionally, the dependency on Flask-SQLAlchemy should be removed, since the module is never imported. |
Great points! Removing the Do you have a sense of how hard it would be to create equivalent |
I don't think it would be too difficult. It looks like there's some extra locking logic around connection creation in And the from sqlalchemy.orm import scoped_session, sessionmaker
session = scoped_session(sessionmaker(bind=engine)) Along with some Theoretically, adapting P.S. Sorry for the slow response, I've been visiting family for the holidays 🙂 |
@connorbrinton Shouldn't it be:
As for If so, to preserve backwards compatibility, you can perhaps test whether |
@jpmckinney Great question 🙂 I have to admit that I don't totally understand everything that's going on with relation to I originally wrote Interestingly, it seems like that original |
I ended up switching to Django (for other reasons) for my project, but I think you're right that there's more work to do around the engine. |
Hi Jean,
As far as I can tell, I don't see any part of the code here that actually requires Flask-SQLAlchemy. I'm currently using it in a project that doesn't use Flask-SQLAlchemy without any problems (Thanks! 😄). However, because the project depends on the Flask-SQLAlchemy package, it gets installed along with my package even though it's not necessary.
I was also hesitant to use the project at all, since I initially thought it would be Flask-SQLAlchemy-specific.
Would it be possible to remove the dependency on Flask-SQLAlchemy, or could you point out the part of the code that depends on it?
Thanks!
The text was updated successfully, but these errors were encountered: