• Item Image
    •  Downloads offline

    •  Downloads: 2641

    •  File Size: 87760

    •  Version: 1.8
    •  Author: Lt. Chambers

Lt. Chambers' new editing program, DBEditor is, as he himself puts it, "DBEditor blows away PFM's editor - it is much more robust, functional, and convenient.". And indeed it is, once you have a grasp on how it works, something many people (myself included) had some trouble with. So, here is a tutorial that is geared mostly toward using the program itself, using both adding a new land unit to the game, and modifying an existing unit as a teaching aid.

When ETW starts up, it reads all the db tables and it has to reconcile where two pack files have a db table with the same name, or two different db tables of the same type have rows with the same primary key. I have reproduced this aggregation of the tables in the read-only aggregate view. It shows cells that have been "modified" (one file table's cell overlapping another) in red and you can mouse-over the modified cells to get a tooltip of the original value. The "aggregate table" doesn't actually correspond to any file in a pack, so I call the tables that do correspond to files in a pack "file tables."

Another very nifty feature is the foreign key combo box. Instead of error-prone free text entry, the combo box lists the valid options for columns which have been determined to be linked to another column (usually in a different table).

For example, every row in "unit_stats_land" must have a unique value for the "Unit" column (this is called the primary key), and furthermore because the "Unit" column is a "foreign key" of "unit_table:ID" each value must first be defined in that table; because unit_stats_land depends on unit_table, it is called a child table and the unit_table is called a parent table.

Other features

- support for adding new tables of the current type either to an existing pack file or a new pack file
- support for table renaming and deletion
- robust copy/cut/paste/clone support: entire rows can be copied/cut to the clipboard and then pasted to tables of the same type, or a single cell's value can be copied and pasted into one or more selected target cells
- support for undoing modifications to selected rows
- see modified values in red and new rows in green
- option to automatically make timestamped backups when pack files are saved
- option to make CA pack files read-only (e.g. main.pack, patch.pack, models.pack, etc.)
- option to freeze primary key column(s) so horizontal scrolling preserves context
- somewhat robust handling of tables which CA added new columns to in recent patches
- right-click column header - runtime renaming of columns and saving the new names to the XSD schema
- "Find Relations" - automagical search for relations between columns and saving the new relations to the XSD schema
- "Find" - search all cells for a user-specified substring
- support for picking primary key at runtime (but this should be used pretty rarely)

The program is definitely not free of bugs, but it should be at least as useful as the PFM's db table editor and probably much more useful.

Changes in 1.8

- added patch3.pack to internal CA pack file list
- fixed load order for pack files which replace other pack files (e.g. patch3.pack replaces patch2.pack, which replaces patch.pack)

Changes in 1.7

- added persistence for the user-selected ETW path
- fixed bugged pack file writing
- added persistence of the mysterious new integer and string in patch2.pack
- fixed trimming of extended properties on schema write
- fixed incorrect keyref in technologies_tables
- disabled the "new row" at the bottom of the grid because setting up default values was problematic; it has been replaced by an "Add Row" menu item
- added a list in the PackLoadingDialog to allow the user to control the load order of selected mod packs (thanks Jinarik)

Changes in 1.6.1

- fixed schema for advice_levels_tables, factions_tables, and quotes_tables (revealed by patch 1.5)
- fixed writing of version 1 pack files (i.e. patch2.pack if someone really wants to modify that)
- fixed load order of pack files (now it's by type and then by version)

Changes in 1.6

- fixed table writing to not use hard-coded version signatures
- fixed table reading to try multiple versions of a table if EndOfStreamException happens (i.e. not trusting it to be the version the table says it is)
- added ErrorBox dialog, improved exception handling

Changes in 1.5.2

- fixed NullReferenceException from returning a null string (thanks Jinarik)
- fixed race condition caused by exiting in PackLoadingDialog (thanks Jinarik)
- merged Swiss Halberdier's DB.xsd (renaming about a dozen unknown columns)
- improved performance of copy-rows-to-clipboard by a few orders of magnitude (oops)
- fixed column order in factions_tables and renamed a few unknown columns (thanks alpaca)

Changes in 1.5.1

- fixed wrong signature written for units_tables

Changes in 1.5

- updated for patch 1.4 (thanks alpaca)
- fixed DB parser so that future DB.xsd updates won't require code changes

Changes in 1.4

- partially addressed an exception caused by foreign key columns referring to values absent from the parent table
- fixed handling of format exceptions during paste
- added a "Constrain Referring Columns" option to the View menu so that users can work around errors caused by tables which violate foreign key constraints
- added PackLoadingDialog to allow the user to choose which packs to load (thanks Jinarik)
- added custom implementation of DataGridViewAutoFilter* to fix column sorting (thanks Jinarik)
- added bold font to packs in PackLoadingDialog that are in the currently selected pack file directory(s) (thanks Jinarik)
- added user settings for saving and restoring pack file directories and selected pack files

Changes in 1.3

- added check for clipboard contents after changing the selected table
- fixed user's ability to add and delete rows on read only tables
- fixed bug where new rows would put empty strings in DBNullable columns instead of DBNull
- switched from enforcing constraints to showing constraint violations as row errors
- improved refreshing of the table/DataGridView after cell edits
- fixed error in DataError handler when the DataRow is in the detached state
- made some small fixes in alpaca's TSV changes which add copy/pasting to/from Excel or OpenOffice Calc:
* removed broken trimming of whitespace
* added support for CRLF line endings
* renewed support for pasting a single value to multiple cells
* renewed merging of rows with existing primary keys
- turned off constraint enforcement
- improved naming of file table relations
- fixed AddNewTableDialog to select first existing pack (if one or more exists)
- fixed misapplied bitwise logic when checking shortcut keys in CopyPasteDataGridView
- fixed minimum selected row count needed to enable "Cut"
- added taxes_effects_jct to table definitions

Changes in 1.2

- fixed decimal point separator bug

[h3]Changes in 1.1/h3]- fixed KeyNotFoundException bug when data directory had no mod packs
- fixed AddNewTableDialog to respect the CA-packs-are-read-only option, to create mod packs instead of release packs, and to disallow creating a new pack file with the same name as an existing pack file
- fixed behavior of adding a file table with the same name as an existing table (if the pack file that contains the new table has the same precedence or higher, it overwrites the file, otherwise the add does nothing)
- added error condition for missing data directory

Requires .NET 3.5 to be installed if you don't already have it:
http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en

DB Editor

Item Image

 Downloads offline


Lt. Chambers' new editing program, DBEditor is, as he himself puts it, "DBEditor blows away PFM's editor - it is much more robust, functional, and convenient.". And indeed it is, once you have a grasp on how it works, something many people (myself included) had some trouble with. So, here is a tutorial that is geared mostly toward using the program itself, using both adding a new land unit to the game, and modifying an existing unit as a teaching aid.

When ETW starts up, it reads all the db tables and it has to reconcile where two pack files have a db table with the same name, or two different db tables of the same type have rows with the same primary key. I have reproduced this aggregation of the tables in the read-only aggregate view. It shows cells that have been "modified" (one file table's cell overlapping another) in red and you can mouse-over the modified cells to get a tooltip of the original value. The "aggregate table" doesn't actually correspond to any file in a pack, so I call the tables that do correspond to files in a pack "file tables."

Another very nifty feature is the foreign key combo box. Instead of error-prone free text entry, the combo box lists the valid options for columns which have been determined to be linked to another column (usually in a different table).

For example, every row in "unit_stats_land" must have a unique value for the "Unit" column (this is called the primary key), and furthermore because the "Unit" column is a "foreign key" of "unit_table:ID" each value must first be defined in that table; because unit_stats_land depends on unit_table, it is called a child table and the unit_table is called a parent table.

Other features

- support for adding new tables of the current type either to an existing pack file or a new pack file
- support for table renaming and deletion
- robust copy/cut/paste/clone support: entire rows can be copied/cut to the clipboard and then pasted to tables of the same type, or a single cell's value can be copied and pasted into one or more selected target cells
- support for undoing modifications to selected rows
- see modified values in red and new rows in green
- option to automatically make timestamped backups when pack files are saved
- option to make CA pack files read-only (e.g. main.pack, patch.pack, models.pack, etc.)
- option to freeze primary key column(s) so horizontal scrolling preserves context
- somewhat robust handling of tables which CA added new columns to in recent patches
- right-click column header - runtime renaming of columns and saving the new names to the XSD schema
- "Find Relations" - automagical search for relations between columns and saving the new relations to the XSD schema
- "Find" - search all cells for a user-specified substring
- support for picking primary key at runtime (but this should be used pretty rarely)

The program is definitely not free of bugs, but it should be at least as useful as the PFM's db table editor and probably much more useful.

Changes in 1.8

- added patch3.pack to internal CA pack file list
- fixed load order for pack files which replace other pack files (e.g. patch3.pack replaces patch2.pack, which replaces patch.pack)

Changes in 1.7

- added persistence for the user-selected ETW path
- fixed bugged pack file writing
- added persistence of the mysterious new integer and string in patch2.pack
- fixed trimming of extended properties on schema write
- fixed incorrect keyref in technologies_tables
- disabled the "new row" at the bottom of the grid because setting up default values was problematic; it has been replaced by an "Add Row" menu item
- added a list in the PackLoadingDialog to allow the user to control the load order of selected mod packs (thanks Jinarik)

Changes in 1.6.1

- fixed schema for advice_levels_tables, factions_tables, and quotes_tables (revealed by patch 1.5)
- fixed writing of version 1 pack files (i.e. patch2.pack if someone really wants to modify that)
- fixed load order of pack files (now it's by type and then by version)

Changes in 1.6

- fixed table writing to not use hard-coded version signatures
- fixed table reading to try multiple versions of a table if EndOfStreamException happens (i.e. not trusting it to be the version the table says it is)
- added ErrorBox dialog, improved exception handling

Changes in 1.5.2

- fixed NullReferenceException from returning a null string (thanks Jinarik)
- fixed race condition caused by exiting in PackLoadingDialog (thanks Jinarik)
- merged Swiss Halberdier's DB.xsd (renaming about a dozen unknown columns)
- improved performance of copy-rows-to-clipboard by a few orders of magnitude (oops)
- fixed column order in factions_tables and renamed a few unknown columns (thanks alpaca)

Changes in 1.5.1

- fixed wrong signature written for units_tables

Changes in 1.5

- updated for patch 1.4 (thanks alpaca)
- fixed DB parser so that future DB.xsd updates won't require code changes

Changes in 1.4

- partially addressed an exception caused by foreign key columns referring to values absent from the parent table
- fixed handling of format exceptions during paste
- added a "Constrain Referring Columns" option to the View menu so that users can work around errors caused by tables which violate foreign key constraints
- added PackLoadingDialog to allow the user to choose which packs to load (thanks Jinarik)
- added custom implementation of DataGridViewAutoFilter* to fix column sorting (thanks Jinarik)
- added bold font to packs in PackLoadingDialog that are in the currently selected pack file directory(s) (thanks Jinarik)
- added user settings for saving and restoring pack file directories and selected pack files

Changes in 1.3

- added check for clipboard contents after changing the selected table
- fixed user's ability to add and delete rows on read only tables
- fixed bug where new rows would put empty strings in DBNullable columns instead of DBNull
- switched from enforcing constraints to showing constraint violations as row errors
- improved refreshing of the table/DataGridView after cell edits
- fixed error in DataError handler when the DataRow is in the detached state
- made some small fixes in alpaca's TSV changes which add copy/pasting to/from Excel or OpenOffice Calc:
* removed broken trimming of whitespace
* added support for CRLF line endings
* renewed support for pasting a single value to multiple cells
* renewed merging of rows with existing primary keys
- turned off constraint enforcement
- improved naming of file table relations
- fixed AddNewTableDialog to select first existing pack (if one or more exists)
- fixed misapplied bitwise logic when checking shortcut keys in CopyPasteDataGridView
- fixed minimum selected row count needed to enable "Cut"
- added taxes_effects_jct to table definitions

Changes in 1.2

- fixed decimal point separator bug

[h3]Changes in 1.1/h3]- fixed KeyNotFoundException bug when data directory had no mod packs
- fixed AddNewTableDialog to respect the CA-packs-are-read-only option, to create mod packs instead of release packs, and to disallow creating a new pack file with the same name as an existing pack file
- fixed behavior of adding a file table with the same name as an existing table (if the pack file that contains the new table has the same precedence or higher, it overwrites the file, otherwise the add does nothing)
- added error condition for missing data directory

Requires .NET 3.5 to be installed if you don't already have it:
http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en


top