Closed timmypidashev closed 3 years ago
Alright here's the problem: the current status of this pr is "working", but 75% of most commands fail because of how i put the async wrappers while trying to find all refs to db objects. My mistake, but I dont have time this week to fix this, as I am currently busy with work, but here is the gist of the problem:
level, exp = await db.record(f"SELECT level, exp FROM users WHERE UserID = {user.id}")
the above query breaks because of tuples and the like, the fix is:
level, exp = (await db.record(f"SELECT level, exp FROM users WHERE UserID = {user.id}")[0])
There are some other exceptions, like [0][0]
, which will also need proper formatting. Any query that takes data and puts it into more than 2 variables should be put into an extra set of ()
just to be safe. I am not completely sure if my implementation is correct, but I suspect there are a lot of easy fixes to this problem. Anyway, use this pr at your will, I have allowed edits by maintainers in case somebody wants to go ahead and use this.
closing due to the upcoming v3 rewrite, all v2 issues and pull requests have been closed.
An asynchronous rewrite to
db
Pre-Merge checklist
[ ] - Made sure there were no bugs by testing the bot on your own Bot Application.
[x] - Added a
CHANGELOG.md
entry if applicable.[x] - Edited the version number in
launcher.py
[x] - Added any dependencies in
requirements.txt
if needed[x] - Updated all references to the synchronous version throughout the botbase
At its current stages this is by no means a working build, and there are missing features, one in particular being the scheduler in the db,
db.autosave
. The reason for small little errors like this is because this is a lot of breaking changes, and as such it might not be worth doing if this pr is not useful. If this pr proves to be successful, i will make sure to test all code changes and add the missing features i was too lazy to add lol.