(Moved from earlier in the thread to update with new info)
The editor now has SQL support! As well as being able to load up mods with SQL files in them, you can enter them straight into the console to quickly edit your database.
In the console at the bottom, you can type select, update and delete statements (the only ones supported so far) and hit return to edit the database on the fly, be that deleting techs or setting values. Using this and the row editor you've got quite the power to edit your whole mod within the editor.
Stuff like:
Delete
Deletes all units.
Code:
delete from units where type=UNIT_ARCHER
Deletes the archer
Code:
delete from units where prereqtech=tech_bronzeworking
Deletes all units on bronze working. Note that where statements are case insensitive.
Code:
delete from technologies where era=era_classical and goodytech=false
Delete all techs in classical era that aren't goody hut techs.
Update
Code:
update units set portraitindex=10
Sets portrait index on all units.
Code:
update units set portraitindex=10, iconatlas=UNIT_ATLAS_1
Sets all units portaitindex AND iconatlas. Note the values for a set
are case sensitive as it will obviously put in the table whatever you write and cannot magically figure out what case you intended. The actual property name case still doesn't matter though.
Code:
update units set portraitindex=10, iconatlas=UNIT_ATLAS_1 where prereqtech=tech_bronzeworking and goodytech=true
Updates can have wheres too...
Select
Code:
select * from technology_prereqtechs
Returns a list of every tech prereq, and the list has columns for every property of the prereq (* = all columns)
Double click any of the results to open the row editor for that row.
Code:
select type, cost, combat from units where type > UNIT_P and cost < 100
Returns a list of every unit with a type beginning alphabetically with UNIT_P or higher, and costing less than 100. Only gets and displays the type, cost and combat columns.
You can click a header to sort by that column.
Things that
aren't supported (yet):
* insert into
* create/drop tables
* or statements / bracketing
* nested statements
----
Other non-sql commands
You can also type 'list' into the console to get a list of every table in the game, double click them to get a full select list of all the rows, double click them to get to the row editor for that row.
That's complete database editing from one place.
---------------
If any command you try fails, post it here and I'll either tell you what you did wrong or add support for / fix that particular command.