curiosity-ai / rocksdb-sharp

.net bindings for the rocksdb by facebook
BSD 2-Clause "Simplified" License
160 stars 39 forks source link

CreateColumnFamily Throw Null access Exception #57

Closed mhorse8 closed 1 week ago

mhorse8 commented 2 weeks ago

{ using var db1 = RocksDb.Open(new DbOptions().SetCreateIfMissing(true), dbPath); db1.CreateColumnFamily(new ColumnFamilyOptions(), "test");// throw exception }

mhorse8 commented 1 week ago

Passing in a ColumnFamilyOptions solves the problem. if (existColumnFamilyNames.Count > 0) _db = RocksDb.Open(dbOptions, dbPath, existColumnFamilyDescriptors); else { _db = RocksDb.Open(dbOptions, dbPath, new ColumnFamilies()); }