kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
479 stars 39 forks source link

How to define a subDB w its types. #253

Closed KaffinPX closed 11 months ago

KaffinPX commented 11 months ago

Its technically a TS question but i think that would be cool to be here too.

kriszyp commented 11 months ago

Can't you do this with parameterized types already? This should open a sub db that specifies numeric keys and string values:

const subDB = db.openDB<string, number>({name: 'test'});
KaffinPX commented 11 months ago

Yes exactly lol, thanks