Open vlad0337187 opened 6 years ago
A little bit help needed =)
I receive such error and cannot figure out why )
Traceback (most recent call last):
File "/home/vlad/my_projects/web/times_new_novel_asyncio/venv/lib/python3.6/site-packages/aiosqlite/core.py", line 143, in run
result = fn()
sqlite3.ProgrammingError: Cannot operate on a closed database.
Traceback (most recent call last):
File "/home/vlad/my_projects/web/times_new_novel_asyncio/test_database.py", line 46, in
Seems, connections of MySql can be executed after exiting of 'with' block, but connections of SQlite - can't.
Hey @vlad1777d ! Thanks for the PR! Hopefully I'll have time to checkout the issue in the next couple of days. Merry Xmas until that!
@kszucs, of course, when you'll have free time.
I'm not very familiar with MySQL, so I can't inspect how it's working. But seems, in query.py, result.py, etc. cursor is used with 'with' block. And seems, that after exiting from that 'with' block, MySQL connections (or cursors), can make .fetchrow().
But SQLite's can't. If so - seems, it's needed some architectural changes, not as I did - make checks for classname to SQLite every now and then.
Yeah, Merry Christmas for you to )
@vlad1777d Still couldn't find time, but I work on it.
@kszucs , yeah, I have little time now too. It doesn't burn, so it can be done whenever =)
Added sqlite.py. But I receive error sqlite3.ProgrammingError: Cannot operate on a closed database.
It's because other files wait, that returned from 'db' instance by 'get_conn' connection will be usable after exiting 'with' block. But for SQLite it's not so. So I need or to create global per\database connection (with large code changes, or to do something other.