UQComputingSociety / uqcsbot-discord

:mortar_board: UQCSbot: Our friendly little Discord bot
https://discord.uqcs.org
MIT License
20 stars 20 forks source link

Switch DB code to use the new Select api #173

Open andrewj-brown opened 1 year ago

andrewj-brown commented 1 year ago

According to the docs, the Query API of SQLAlchemy has been effectively replaced by the Select API, and is now effectively only a compatibility layer.

https://docs.sqlalchemy.org/en/20/orm/queryguide/query.html

As such, we should try to go through and move all our code to Select instead of Query.

I've tagged infra-only because this heavily involves the DB. However, I believe the vast majority of the changes don't actually need infra access - it will just need to be very thoroughly tested and have infra online at merge time in case something comes up.

JamesDearlove commented 1 year ago

I think this is probably a low priority item just because there is no current plan to deprecate the existing API. However, definitely would be good when people go in and work on the couple of areas that use the database to update the queries