File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -590,6 +590,10 @@ typedef void (^RestoreBlock)(NSError * __autoreleasing *);
590
590
- (nullable id )withBulkLoad : (id (NS_NOESCAPE ^)(void ))actionBlock
591
591
error : (NSError * __autoreleasing *)error ;
592
592
593
+ #pragma mark - Repair
594
+
595
+ + (BOOL )repairDB : (NSString *)dbPath options : (RocksDBOptions *)options error : (NSError **)error ;
596
+
593
597
@end
594
598
595
599
NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change @@ -804,4 +804,19 @@ - (nullable id)withBulkLoad:(id (NS_NOESCAPE ^)(void))actionBlock
804
804
return result;
805
805
}
806
806
807
+ #pragma mark - Repair
808
+
809
+ + (BOOL )repairDB : (NSString *)dbPath options : (RocksDBOptions *)options error : (NSError **)error {
810
+ rocksdb::Status s = rocksdb::RepairDB (dbPath.UTF8String , options.options );
811
+
812
+ if (!s.ok ()) {
813
+ if (error != NULL ) {
814
+ *error = [RocksDBError errorWithRocksStatus: s];
815
+ }
816
+ return NO ;
817
+ }
818
+
819
+ return YES ;
820
+ }
821
+
807
822
@end
You can’t perform that action at this time.
0 commit comments