-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
WIP: Initial code for aiosqlite and base async backend #15357
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Include async alru_cache and aatomic Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
* This should help with identifying whether an engine can perform a certain task * Added async transaction tests cases and backend + introspection test cases * Fixed AsyncContextDecorator only being a Python 3.10 feature The initial thought for using ASYNC_DATABASES was so that Django internally for its test suite could skip a test module if it required a sync driver and not an async driver or vice versa. The issue is DEP 9 states that migrations should be synchronous only (probably to reduce number of lines of code). This means an implementation performed here will be used for Django users as well. This commit does not include a way to do that, but instead of ASYNC_DATABASES, we use SYNC_DATABASES in the Django settings. This is so that Django Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
* Fix async with cursor creation * Use connections["async"] directly for POC sake * Properly close connections in test cases Test suite does hang for some reason Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
* Fix async with cursor creation in Django core files themselves Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
* Don't use mirrors * Fixed other missing attribute bugs Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
* Fix TransactionTestCase to properly handle atomic blocks (can't use async_to_sync) Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Can't seem to figure out why the socket is not being closed (assuming this is the async side):
|
Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
it's works fine!!! |
Closing due to inactivity. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding async backend Base and aiosqlite -- someone else can pick it up if I become inactive.
aatomic probably shouldn't have been implemented in this PR, but I also couldn't think of another time it could be implemented without a Base async backend.
There is no associated ticket as of yet. This was made a month ago, but because I could never pick this up due to classes, I made a PR for others to take advantage of. I should have time after February 20th to get back to this.
To write transaction test cases, it requires the async ORM.