Swap out tortoise-orm with... something else
AstreaTSS opened this issue · 4 comments
tortoise-orm
is... not dead, per se, but it's pretty evident that it's essentially on maintenance-only mode. Its typehinting is also lackluster, and its feature set is sometimes limiting.
Ideally, we would switch over to prisma
(the Python variant), as the Realms Playerlist Bot has done. It produces amazing typehints and is well supported.
The only real issue with Prisma is that my current database provider for this bot, Supabase (yes, under its free tier, only the Playerlist Bot pays for a database right now), provides a URL for connections under IPv4 that Prisma cannot handle (mostly because the URL is technically invalidly formatted). The IPv6 URL can be handle by Prisma, but IPv6 has issues on the computers I use to test and run the bot, so some workaround has to be found. I have ideas, but who knows.
If I can't find a workaround, another library will have to be found, ideally one that can support psycopg
as well as the current asyncpg
as I've heard that psycopg
can handle the string better. An alternative is switching to another (free) database provider, which is becoming more tempting by the day, admittedly.
The database has been switched to one that uses IPv4 properly. Thus, I'll likely end up using Prisma.
Turns out Prisma doesn't have case-insensitive comparisons for scalar lists/arrays, as noted by prisma/prisma#8387.
This unfortunately means we're forced to use another ORM, as said comparisons are used often in Ultimate Investigator.
Seems like most ORMs can't support this simple feature, ugh.
If anyone finds one that can, link it here. Otherwise, I'll keep using tortoise until/unless Prisma finally gets a move on with the above PR (seems unlikely, since it's been dead for a while).
Decided to just make my own queries for case-insensitive comparisons against arrays.