whoward69
DLL Minion
SQLiteSpy is a third party utility for executing SQL statements directly against an SQLite database (.db) file. This tutorial covers the basic use of this utility for testing Civ5 SQL statements outside of the game environment.
First we need to download the utility
We don't need to install the utility, we can just execute it
Now we need to open the SQLite database used by the game
(Note 1: The Civ5DebugDatabase.db file contains the modded database, the Civ5CoreDatabase.db file contains the unmodded database)
(Note 2: After you have opened a .db file, you can quickly open it again by selecting it from the "File -> Reopen" menu)
The interface is divided into four main areas
You can quickly see the contents of a table by double clicking on it, so scroll down to the Buildings table in the left hand list and double click it
This displays every column, so if you just want to see a few, eg the cost of buildings, enter "SELECT Type, Class, Cost, FaithCost FROM Buildings;" into the top area and from the "Execute" menu, select "Execute SQL" (or just press the F9 key)
Click the Cost column to sort by cost ascending, click it again for descending
Can't spell "Neuschwanstein"? Click on the value in the Type column and copy/paste it from the bottom area
Change the SQL to "SELECT Type, UnitClass, Cost, FaithCost FROM Units;" and press F9
An error is displayed - "no such column: UnitClass" (does that format look familiar?)
The column in the Units table is Class (not UnitClass) so click OK to clear the error, change the SQL and press F9
Moderator Action: Updating link for SQLiteSpy - Pouakai
First we need to download the utility
- Go to SQLiteSpy - https://www.yunqa.de/delphi/apps/sqlitespy/index
- Click the download link (top left)
- Download the zip file
- Extract the SQLiteSpy.exe file from the zip and save it into its own sub-directory somewhere (don't bother with the .dll or .db3 file in the zip)
- Virus scan it (paranoia is good!)
We don't need to install the utility, we can just execute it
- Double-click the .exe to run the application (it will create a new .db3 file in the same sub-dir)
Now we need to open the SQLite database used by the game
- From the "File" menu, select "Open database ..."
- Browse to "My Games\Sid Meier's Civilization 5\cache"
- Select the "Civ5DebugDatabase.db" file and click the "Open" button
(Note 1: The Civ5DebugDatabase.db file contains the modded database, the Civ5CoreDatabase.db file contains the unmodded database)
(Note 2: After you have opened a .db file, you can quickly open it again by selecting it from the "File -> Reopen" menu)
The interface is divided into four main areas
- on the left is a list of all the tables in the database
- top right is an edit area for entering SQL statements
- middle right are the results for the last executed SQL statement
- bottom right is a read-only edit area that can be used to copy a value from a column
You can quickly see the contents of a table by double clicking on it, so scroll down to the Buildings table in the left hand list and double click it
This displays every column, so if you just want to see a few, eg the cost of buildings, enter "SELECT Type, Class, Cost, FaithCost FROM Buildings;" into the top area and from the "Execute" menu, select "Execute SQL" (or just press the F9 key)
Click the Cost column to sort by cost ascending, click it again for descending
Can't spell "Neuschwanstein"? Click on the value in the Type column and copy/paste it from the bottom area
Change the SQL to "SELECT Type, UnitClass, Cost, FaithCost FROM Units;" and press F9
An error is displayed - "no such column: UnitClass" (does that format look familiar?)
The column in the Units table is Class (not UnitClass) so click OK to clear the error, change the SQL and press F9
Moderator Action: Updating link for SQLiteSpy - Pouakai
Attachments
-
SQLiteSpy101_01.jpg27.2 KB · Views: 2,789
-
SQLiteSpy101_02.jpg94 KB · Views: 2,683
-
SQLiteSpy101_03.jpg66.9 KB · Views: 2,770
-
SQLiteSpy101_06.jpg133.2 KB · Views: 2,710
-
SQLiteSpy101_07.jpg129 KB · Views: 2,706
-
SQLiteSpy101_09.jpg121 KB · Views: 2,693
-
SQLiteSpy101_08.jpg114.2 KB · Views: 2,738
-
SQLiteSpy101_04.jpg157.5 KB · Views: 2,647
Last edited by a moderator: