In another thread I explained why I choose SQLite to be used. It is a very, very lightweight non-zero-configuration database. You don't have to install other libraries or programs, and you don't need another SQL Server running on your computer.
Sure it isn't a perfect database if you compare it with Oracle, MySQL or Postgres, but it is very easy to use. For my project (a Singleplayer Game) it is perfect.
I prepare all the tables and contents i need: during runtime, i dont alter any table. I create a new database in memory, and load a "template" into this database. The "template" is my database structure, with all tables and columns.
During runtime I only insert, update, delete and query rows. For saving a game, simply dump the "gameplay" db to disk. Loading: load from disk into memory and then load the map (startup of map initalizes all the actors saved to database, maybe spawn them and set their properties).
Note:
If you wanna connect with MySQL or anything else, you are free to write another SQLDriver which wraps all the library functions from your choosen library (MySQL, Postgres, whatever). But in that case I would like to get the changes too, so it can be added to the project as well (open source, you know?).
Btw: Chopkeeper, thanks for all the explanations. I couldn't write it better.
Sure it isn't a perfect database if you compare it with Oracle, MySQL or Postgres, but it is very easy to use. For my project (a Singleplayer Game) it is perfect.
I prepare all the tables and contents i need: during runtime, i dont alter any table. I create a new database in memory, and load a "template" into this database. The "template" is my database structure, with all tables and columns.
During runtime I only insert, update, delete and query rows. For saving a game, simply dump the "gameplay" db to disk. Loading: load from disk into memory and then load the map (startup of map initalizes all the actors saved to database, maybe spawn them and set their properties).
Note:
If you wanna connect with MySQL or anything else, you are free to write another SQLDriver which wraps all the library functions from your choosen library (MySQL, Postgres, whatever). But in that case I would like to get the changes too, so it can be added to the project as well (open source, you know?).
Btw: Chopkeeper, thanks for all the explanations. I couldn't write it better.
Comment