Warpten / DBClientFiles.NET

The new version of DBFilesClient.NET.
GNU General Public License v3.0
11 stars 5 forks source link

Support for DBs without an Index #4

Closed barncastle closed 5 years ago

barncastle commented 6 years ago

Hopefully not a major implementation issue but WDBC and WDB2 don't necessarily have an Index constraint, for example pre-WotLK CharBaseInfo. The client handles this by generating Ids based on the record index on load.

struct CharBaseInfoRec // Alpha 0.5.3.3368
{
  char m_raceID;
  char m_classID;
  int m_proficiency;
  int m_generatedID; // not in file
};

P.S. Great work, I'll be using this for WDBX once write support is in!

Warpten commented 6 years ago

Thank you! I've put this off for months because I was burnt out on Wow (still kind of am).

This was fine for earlier builds since I did not have a key constraint on WDBC and WDB2 - I had to add it for StorageDictionary (the reflection call is a pain in the ass but I have no better idea). There were points where I was considering dropping StorageDictionary and letting users use LINQ's ToDictionary, which is more flexible, but ... idk.

I'll look into it more once I'm done-ish with the automapper

Warpten commented 6 years ago

Not sure about how to handle this - should I force the user to provide an [Index] field even when the file doesn't have one (and populate it myself) (which would be easier for me to deal with, like, a whole lot) - or should I just not care about index at all write some sort of polyfill to keep StorageDictionary alive?

funjoker commented 6 years ago

RowNumber = Index i would say.

Warpten commented 5 years ago

This is done out of the box now: