Where does CiV keep it's SQLite database?

Lord Yanaek

Emperor
Joined
Aug 15, 2003
Messages
1,643
Hello. this might be a silly question, but i can't seem to find it either in the Steam folder or in the logical place (as it's a temporary file) : the appdata folder.

I would like to have a look at the tables to learn their structure so i can use SQLite statements to enter mod data. I've used SQLite more than XML and it's probably faster to use SQLite requests directly than write some XML files that need to be translated into SQLite. I see only benefits of using SQLite, except for the fact that XML data is easy to find, while the SQLite tables are nowhere i can look for them :rolleyes:

I would guess they are cleared only when mods are loaded rather than each time the game quits, but i may be wrong of course. Maybe i must search for them while i have a game running. :think:
 
The database is in My Documents\My Games\Sid Meier's Civilization 5\cache\Civ5DebugDatabase.db. It's not cleared when you exit the game.
 
They are in the cache directory in your Mods directory. Make sure you open the "debug" rather than the "core" db. They are created during game start and persist after you exit the game. I frequently troubleshoot sql statements by running them from SQlite Manager with the db open -- you can do this during or after a game. One note of caution: be careful to close the db before you restart a game.
 
Thanks for quick answer. :bowdown:

Well, i didn't thought about looking next to the saves and mods. It makes sense. However i would never have looked in Civ5DebugDatabase.db :crazyeye:
 
Pazyryk said:
One note of caution: be careful to close the db before you restart a game.

I have no problems when I keep the debug database open (in the SQLite Manager addon to Mozilla Firefox) while making changes to the mod and restarting the game multiple times. (I suppose it's called "Debug" because the database the game actually uses is located in the memory, and this is only a copy that can be used for debug purposes.)

Keeping the localization database open causes problems indeed, but not the debug database.
 
@PowelS, I thought I had seen some problems with this -- but that was 2 yrs ago when I was first learning SQL. Maybe fixed with patches or an imaginary problem.
 
Back
Top Bottom