-
Notifications
You must be signed in to change notification settings - Fork 888
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
Added super basic Alembic configuration to the alchemy paster template #1625
Conversation
@mmerickel BTW should we agree to update the pattern used for SQLA to something similar to this? |
Back home now... So I guess there are still a few things to decide.
And there is the matter of testing. I'm currently unsure how to create the necessary tests for the resulting output of the paster templates. I'll try to dig into the code a bit to see what kind of tests are currently written for the paster templates. |
You could switch to Wichert’s pyramid_sqlalchemy. —Paul
|
@pauleveritt I could be mistaken but I didn't see any Alembic support with the pyramid_sqlalchemy package. I also think there was some discussion about setting up the paster template with a non global (or non scoped I think in sqlalchemy lingua.) BTW is there separate ticket for that? |
Sorry about that, I was responding to Blaise’s ticket about SQLA setup in Pyramid. You’re right that the topic should be in a different ticket. —Paul
|
@pauleveritt the discussion we had with @mmerickel and others was about avoiding to use sqla's scoped_session for the better |
I was hoping someone comment on that issue in which I created, but thank you for making this PR @nek4life |
What's the consensus on the issue right now? |
@ergo It's nice 👍 |
@ergo 👍 from me, even though documentation is completely missing. |
The alchemy scaffolding changes are already massive. I'm pretty afraid to merge this until that dust has settled. In general I'm not particularly excited about merging an alembic setup into pyramid's core scaffold at all but it seems like the idea has a fair amount of support. Work that needs to be done here to have a hope of merging:
Chicken-and-the-egg here: these changes will likely be easier to do after waiting until the other scaffold changes are complete in #2024. |
I have also my own solution to alembic - one that integrates with initialize_db script - so no work would be required on tutorials apart changing the location initial model migration. I'm more concerned about the fact that alembic will not work with sqlite at all - if memory serves me right. |
Alembic has grown support for SQLite over the years but it does have a few quirks as can be expected.
I'm saying someone MUST update the tutorial to explain the features. :-) |
I might have a look at this project and try to integrate inklesspen's project and the new 1.7 compatibility changes. |
This work should be done on https://github.com/Pylons/pyramid-cookiecutter-alchemy. Anyone is welcome to contribute alembic support there. |
Created a super basic alembic configuration for the alchemy paster template for issue #1597. I'd like to get feedback on the approach and whether or not this is something to be pursued. If so I'll go ahead and create tests and documentation to go along with the patch. I will likely need help writing tests for the template output as it doesn't seem as straight forward as writing a regular unit test.