SQLite objects created in a thread can only be used in that same thread.
See original GitHub issueHi @lemon24
Thanks for making this library.
I am attempting to utilise it for a Telegram bot I am working on. However, I run into the following error:
SQLite objects created in a thread can only be used in that same thread.
Here is my code 😃
Doing some quick Google searching I might need to do something similar to what is recommended in this stack overflow post.
However, I cannot see a way I can provide this to the library currently.
Hope you can help. Thanks and a merry Christmas to you! 🎄
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Objects created in a thread can only be used in that same thread
By default, check_same_thread is True and only the creating thread may use the connection. If set False, the returned connection may be shared ......
Read more >Error SQLite objects created in a thread can only be used in ...
My script used to migrate data from SQLite to Postgres in Python. ... SQLite objects created in a thread can only be used...
Read more >SQLite objects created in a thread can only be used in that ...
PYTHON : ProgrammingError: SQLite objects created in a thread can only be used in that same thread [ Gift : Animated Search Engine ......
Read more >ProgrammingError: SQLite objects created in a thread can ...
ProgrammingError : SQLite objects created in a thread can only be used in that same thread. The object was created in thread id...
Read more >SQLite objects created in a thread can only be used in that ...
Error in Debug mode - sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @lemon24
This looks awesome! Hopefully I’ll have some time soon to test this out for my bot. Also thanks for the suggestion issue as well 🙂👍🏻
Hi @dbrennand, starting with reader 2.15, it is now possible to use a reader object from multiple threads; docs.
It should now be possible to have a global Reader object in bot.py. So, instead of this:
… you can now do this, which should be a bit more ergonomic:
Some notes:
with reader: ...
once per thread; this might improve in the future.