diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index fcd70f2ebef0146fe0bd1d90e52d67805e6d49f6..884e0b63485ec23e3d820576225a0b5596de39af 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -897,6 +897,45 @@ int OH_Rdb_SubscribeAutoSyncProgress(OH_Rdb_Store *store, const Rdb_ProgressObse * @since 11 */ int OH_Rdb_UnsubscribeAutoSyncProgress(OH_Rdb_Store *store, const Rdb_ProgressObserver *observer); + +/** + * @brief Lock data from the database based on specified conditions. + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param predicates Represents a pointer to an {@link OH_Predicates} instance. + * Indicates the specified lock condition. + * @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}. + * @see OH_Rdb_Store, OH_Predicates, OH_Rdb_ErrCode. + * @since 12 + */ +int OH_Rdb_LockRow(OH_Rdb_Store *store, OH_Predicates *predicates); + +/** + * @brief Unlock data from the database based on specified conditions. + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param predicates Represents a pointer to an {@link OH_Predicates} instance. + * Indicates the specified unlock condition. + * @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}. + * @see OH_Rdb_Store, OH_Predicates, OH_Rdb_ErrCode. + * @since 12 + */ +int OH_Rdb_UnlockRow(OH_Rdb_Store *store, OH_Predicates *predicates); + +/** + * @brief Queries data in the database based on specified conditions. + * + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. + * @param predicates Represents a pointer to an {@link OH_Predicates} instance. + * Indicates the specified query condition. + * @param columnNames Indicates the columns to query. If the value is empty array, the query applies to all columns. + * @param length Indicates the length of columnNames. + * @return If the query is successful, a pointer to the instance of the @link OH_Cursor} structure is returned, + * otherwise NULL is returned. + * @see OH_Rdb_Store, OH_Predicates, OH_Cursor. + * @since 12 + */ +OH_Cursor *OH_Rdb_QueryLockedRow(OH_Rdb_Store *store, OH_Predicates *predicates, const char *const *columnNames, int length); #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 3ca54056f1c0191b60f8ec06b578b9d51cc97610..68882bc8a4cce6cbbbe52a5a8d4e8b2aea318418 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -45,5 +45,8 @@ {"name":"OH_Rdb_Subscribe"}, {"name":"OH_Rdb_Unsubscribe"}, {"name":"OH_Rdb_SubscribeAutoSyncProgress"}, - {"name":"OH_Rdb_UnsubscribeAutoSyncProgress"} + {"name":"OH_Rdb_UnsubscribeAutoSyncProgress"}, + {"name":"OH_Rdb_LockRow"}, + {"name":"OH_Rdb_UnlockRow"}, + {"name":"OH_Rdb_QueryLockedRow"} ] \ No newline at end of file