-
Notifications
You must be signed in to change notification settings - Fork 97
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
Support pysqlite3 for newer sqlite versions #100
Comments
Another alternative is to pass in a sqlite variable into the connect method so people can inject their own sqlite adapter if needed. |
I'd be happy to review a PR that attempts to |
@jreese Unfortunately, there are some limitations with pysqlite over sqlite3 since not all features are present. In particular, multiple queries, multiple connections, and iterdump are not supported/implemented by pysqlite. You can see the changes I made here. If this is acceptable (which I think is reasonable), I'll submit it as a pull request. |
I forgot just how many modules import pieces of sqlite3. I think that doing your approach right would require both moving all of those imports into something like a aiosqlite.db module that handles the logic to import pysqlite when available, and then having everything else import from that module without needing a conditional. Also, for test cases, I would rather see use of something like All that said, I think it would also be nice to have an option on whether pysqlite is used (the limited functionality is the biggest concern IMO), so that there's a way to test against both sqlite3 and pysqlite3 when available, otherwise having pysqlite installed to test pysqlite will prevent testing against sqlite3 or any of the features that pysqlite doesn't support. Maybe the more correct direction would start with something like #106, and have a pysqlite3-based connector that the connector can instantiate when requested, which would allow both connection types to exist simultaneously for testing. |
@boulderwebdev - sorry for asking on something 2+ years old, but can you clarify where multiple queries/connections are not supported? As far as I know only iterdump (which was janky and should not be used, anyways) is the only thing missing:
|
Description
Currently aiosqlite relies upon importing the standard sqlite3 module from the python library. For many users, that is OK, but if you want to deploy your code on some platforms, the SQLite version installed by default cannot be easily upgraded through a package manager and some features are not available to these users (e.g. using WITHOUT ROWID in a table).
One avenue for fixing this issue is providing support for using pysqlite3 instead of the standard sqlite3 module. This can be done by either
For 2, I mean there should be the following two variations for installing aiosqlite
similar to how uvicorn gives the
standard
option while installing.Details
3.7.9
0.16.0
3.7.17
but pysqlite3 supplies version3.34.0
The text was updated successfully, but these errors were encountered: