pcparadise / discordbot

GNU General Public License v3.0
3 stars 5 forks source link

Migrating from Pure SQL Queries to Tortoise ORM or PyPika #59

Open Ganoodles opened 1 year ago

Ganoodles commented 1 year ago

ISSUE:

The current implementation of our application relies solely on writing raw SQL queries using aiosqlite, which is inconvenient, lacking in structure, and not to mention vastly intimidating to people who are unfamiliar with SQL. To address these limitations and improve our bot structure, I propose a complete transition to Tortoise ORM, or PyPika.

PROPOSAL

I'm personally in favor of moving fully to Tortoise ORM. This would be more structured, cleaner, and easier to work with; On the other hand, if we just wanted to switch away from SQL queries we could debate using something like PyPika just to create them. But I'm still personally not a fan of manually defining migrations like we currently are.


Overall this would be fairly easy to implement as Tortoise ORM is already compatible with our current database.db, migration shouldn't be much of an issue.

awsomearvinder commented 1 year ago

If you want an ORM rather then a query builder, what about something like PonyORM?