isar / hive

Lightweight and blazing fast key-value database written in pure Dart.
Apache License 2.0
4.1k stars 407 forks source link

Make TypeAdapter.typeId a string #907

Open lukepighetti opened 2 years ago

lukepighetti commented 2 years ago

It looks like there may be a concern of type adapter collision if more than one adapter uses the same typeId.

If this is true, I'm wondering if it would be better if it was a String instead.

An easy migration path is to use the hashCode of String typeId to get an int value that could be used otherwise, then recommend that people give each type adapter a unique name.

If my understandings here are wrong, please let me know if this is documented somewhere.

newntech commented 2 years ago

This would be very useful! Risk of conflict is too high currently.