openfootmanager / openfootmanager

An open source soccer/football manager game
GNU General Public License v3.0
125 stars 14 forks source link

SQLite database #35

Open sturdy-robot opened 11 months ago

sturdy-robot commented 11 months ago

I'm considering using SQLite instead of JSON for in-game database. I'm still deciding over database schema, whether we need to divide data into different .db files, or just use one database with many tables for everything. This is important to create a savefile later on. My ideas for savefiles will go in another issue, but I think if we implement an actual database, we can improve performance to load teams and players.

Another thing I'm considering is to use SQLAlchemy instead of pure SQL. This project uses a lot of dataclasses, so it isn't that bad to convert to SQLAlchemy models.

tonyemery commented 10 months ago

This is a very good idea. I'd suggest a database with several schemas and tables. In fact, you could have a schema for backups.