item_template no longer in DB

I am creating an online database viewer for TrinityCore master and I just finished the styling and Javascript. The database uses JQuery, JQuery UI Tabs, and JQuery DataTables. I am trying to recreate wowhead but one that reads TrinityCore’s database so it would be easier to work with the database and see values in a human readable form. I am intending to release the source to TrinityCore so anybody would be able to use it. It has full functioning tooltips, sorting, pagination, tabs, etc.

Just when I went to start the php code to query the database, I realized the world schema is missing the table item_template. This is crucial for being able to search items. I read that it is now stored in .db2 files, but I have absolutely no idea how to search them, let alone extract/open/read them.

Does anybody have any idea how to search for items in the TrinityCore database? Thanks

Edit: I've read that .db2 is a database file, similar to how .sql is a database file. If I could find a tool that can convert the .db2 file to either .sql or .csv, I could create a sql database specifically for the website.

I've attached a picture of the database with a test item populating the table

[ATTACH]2148._xfImport[/ATTACH]

Don’t know if there are any updated tools for this matter, but what you can do is (with PHP):

[ol][li]Read file as binary (‘rb’ option for fopen)[/li]
[li]Read first 4 bytes of the stream to find out which type of the file it is (WDB2, WDB5, etc)[/li]
[li]Unpack stream of bytes (according to order of bytes)[/li]
[li]Perform any necessary operations to get data from the file[/li]
[/ol]
I’ve made a script for doing that, however, cant share it, since it depends on the other framework classes and methods, and obviously i cannot share the framework (for now).

Can only give you the following part (these are the variables you will most likely need to work with)

[CODE]
protected $wdbVersion = 0;
protected $isWDBC = false;
protected $idField = 0;
protected $idMap = [];
protected $headerFieldCount = 0;
protected $recordCount = 0;
protected $fieldCount = 0;
protected $recordSize = 0;
protected $stringBlockSize = 0;
protected $tableHash = 0;
protected $layoutHash = 0;
protected $build = 0;
protected $timestamp = 0;
protected $flags = 0;
protected $minId = 0;
protected $maxId = 0;
protected $locale = 0;
protected $commonBlockSize = 0;
protected $copyBlockSize = 0;
protected $headerSize = 0;
protected $headerFormat = null;
protected $preambleLength = 0;
protected $hasEmbeddedStrings = false;
protected $totalFieldCount = 0;
protected $hasIdBlock = false;
protected $hasIdsInIndexBlock = false;
protected $idBlockPosition = 0;
protected $indexBlockPosition = 0;
protected $commonBlockPosition = 0;
protected $stringBlockPosition = 0;
protected $copyBlockPosition = 0;
protected $endOfFile = 0;
protected $recordFormat = [];
protected $recordOffsets = null;
protected $commonLookup = [];

[/CODE]

with PhP? yes. I can share tidbits

Possible with extract the db2 and export the tables for example(sql/json/csv) with WDBX Editor (Link https://github.com/WowDevTools/WDBXEditor)

ItemSparse.db2 is example has 99k + Rows ,but i think that is only the tip, there is plenty of other item*.db2 files maybe required to link for all the info.

Any news about site?

I abandoned the project after I got it up and running, 6 years ago. The javascript table library I was using was very problematic and had performance issues, and the php code wasnt great either.

There are much better implementations available on github now. I dont have the code anymore, that was a couple of computers ago. I wouldve shared the code if I couldve got it anywhere near production ready but it ended up being a mess. It worked for me though but there’s better available now. I cant seem to find one atm but i know ive seen one.

I actually do have video of some testing, this was before i implemented the javascript table. This really doesnt require much effort to put together, but using views for the tables in the db would prob be much more efficient.