diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index b8be9a6aa7948d0c7391250047554e9349400754..35910676196915c4110522bb5b6f82f9153b029b 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -426,6 +426,22 @@ int OH_Rdb_DeleteStore(const OH_Rdb_Config *config); */ int OH_Rdb_DeleteStoreV2(const OH_Rdb_ConfigV2 *config); +/** + * @brief Repair an RDB store with OH_Rdb_ConfigV2. + * + * You can repair the RDB store when database corrupted. + * + * @param config Represents a pointer to an {@link OH_Rdb_ConfigV2} instance. + * Indicates the configuration of the database related to this RDB store. + * @return Returns the status code of the execution. Successful execution returns RDB_OK, + * {@link RDB_OK} - success. + * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. + * Get database path failed.Get RDB Store fail. Nullptr is returned. + * @see OH_Rdb_ConfigV2, OH_Rdb_Store. + * @since 14 + */ +int OH_Rdb_Repair(const OH_Rdb_ConfigV2 *config); + /** * @brief Inserts a row of data into the target table. * diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 5e068186572195d21f1a7863fa18a8ec89d38577..beaa9ef8a4518e9241655a0e6e25b50cf292dbba 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -57,6 +57,10 @@ "first_introduced": "14", "name":"OH_Rdb_DeleteStoreV2" }, + { + "first_introduced": "14", + "name":"OH_Rdb_Repair" + }, {"name":"OH_Rdb_Insert" }, {"name":"OH_Rdb_Update" }, {"name":"OH_Rdb_Delete" },