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

Replace aiosqlite with sqlite-anyio #22

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

davidbrochart
Copy link
Collaborator

No description provided.

@davidbrochart davidbrochart force-pushed the sqlite-anyio branch 13 times, most recently from b07c3f2 to c4a2d1a Compare March 22, 2024 09:24
@Zsailer
Copy link
Member

Zsailer commented Mar 22, 2024

Can you justify this change a little bit more? Were there specific things in aiosqlite that blocked you enough to create a new package?

I haven't spent enough time using anyio to understand why, in this particular case, it would prompt a switch away from aiosqlite (which is heavily "battle-tested").

I can see that sqlite-anyio is essentially a package around a gist that the main developer of anyio wrote—but do you have a sense for how reliable it is?

@Zsailer
Copy link
Member

Zsailer commented Mar 22, 2024

Ah, I now see this issue: jupyterlab/jupyter-collaboration#252

@davidbrochart
Copy link
Collaborator Author

I haven't spent enough time using anyio to understand why, in this particular case, it would prompt a switch away from aiosqlite (which is heavily "battle-tested").

In general, there is value in adopting structured concurrency. We just made the switch to AnyIO in ipykernel.
aiosqlite is asyncio-only. With sqlite-anyio, pycrdt-websocket could work on top of asyncio or Trio.

I can see that sqlite-anyio is essentially a package around a gist that the main developer of anyio wrote—but do you have a sense for how reliable it is?

I contacted the author of the gist, who is fine with the package I created around it. It is a thin layer on top of sqlite, basically wrapping the blocking methods with AnyIO's to_thread(). I created tests and there is 100% coverage, so I think it is reliable.

@davidbrochart davidbrochart merged commit a016d14 into jupyter-server:main Mar 25, 2024
6 checks passed
@davidbrochart davidbrochart deleted the sqlite-anyio branch March 25, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants