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
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)
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.
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.