xaya / libxayagame

MIT License
21 stars 19 forks source link

Decouple database from SQLiteGame #96

Closed domob1812 closed 4 years ago

domob1812 commented 4 years ago

This introduces a new class, SQLiteDatabase. This is a thin wrapper around sqlite3* handles, but also implements the statement-preparation logic that used to be part of SQLiteStorage itself.

Instead of sqlite3*, the new SQLiteDatabase instances are now passed to all callbacks / subclass functions of SQLiteGame. This also gets rid of the weird issue that SQLiteGame was used as a de-facto database handle due to it being the class that handles prepared statements.

With this, the required refactoring (especially also to actual GSPs using the code) that is a prerequisite of #95 is implemented.