coleifer / pysqlite3

SQLite3 DB-API 2.0 driver from Python 3, packaged separately, with improvements
zlib License
183 stars 51 forks source link

Add instructions on replacing the `sqlite3` module #65

Closed mrexodia closed 1 year ago

mrexodia commented 1 year ago

This came in very handy for me when I needed to use sqlalchemy (where I cannot change the code). This trick works because import sqlite3 will first look in sys.modules["sqlite3"], meaning we can replace that instance with pysqlite3.

coleifer commented 1 year ago

I'm going to pass -- I'm also not sure that is correct because you probably need to set the sqlite3 to pysqlite3.dbapi2...

mrexodia commented 1 year ago

I’ve been using this for the past month with sqlalchemy without any problems…