1e41f4b71Sopenharmony_ci# Distributed Data Management Subsystem JS API Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.distributeddatamgr.1 API Change 4e41f4b71Sopenharmony_ciChanged the APIs in **kv_store** of the distributed data management subsystem: 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciChanged the **createKVManager()** implementation from asynchronous mode to synchronous mode because the execution duration is fixed and short. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ciBefore change:<br>**createKVManager(config: KVManagerConfig): Promise\<KVManager\>;**<br>**createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager>): void;**<br>After change:<br>**createKVManager(config: KVManagerConfig): KVManager;** 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ciYou need to adapt your application. 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**Change Impact** 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ciJS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci**Key API/Component Changes** 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| Module | Class | Method/Attribute/Enum/Constant | Change Type| 19e41f4b71Sopenharmony_ci| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | 20e41f4b71Sopenharmony_ci| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): Promise\<KVManager\>; | Deleted | 21e41f4b71Sopenharmony_ci| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | Changed | 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci**Adaptation Guide** 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ciThe following illustrates how to call **createKVManager** to create a **KVManager** object. 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ciStage model: 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci```ts 31e41f4b71Sopenharmony_ciimport AbilityStage from '@ohos.application.Ability' 32e41f4b71Sopenharmony_cilet kvManager; 33e41f4b71Sopenharmony_ciexport default class MyAbilityStage extends AbilityStage { 34e41f4b71Sopenharmony_ci onCreate() { 35e41f4b71Sopenharmony_ci console.log("MyAbilityStage onCreate") 36e41f4b71Sopenharmony_ci let context = this.context 37e41f4b71Sopenharmony_ci const kvManagerConfig = { 38e41f4b71Sopenharmony_ci context: context, 39e41f4b71Sopenharmony_ci bundleName: 'com.example.datamanagertest', 40e41f4b71Sopenharmony_ci } 41e41f4b71Sopenharmony_ci try { 42e41f4b71Sopenharmony_ci kvManager = distributedKVStore.createKVManager(kvManagerConfig); 43e41f4b71Sopenharmony_ci } catch (e) { 44e41f4b71Sopenharmony_ci console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`); 45e41f4b71Sopenharmony_ci } 46e41f4b71Sopenharmony_ci } 47e41f4b71Sopenharmony_ci} 48e41f4b71Sopenharmony_ci``` 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ciFA model: 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci```ts 53e41f4b71Sopenharmony_ciimport featureAbility from '@ohos.ability.featureAbility' 54e41f4b71Sopenharmony_cilet kvManager; 55e41f4b71Sopenharmony_cilet context = featureAbility.getContext() 56e41f4b71Sopenharmony_ciconst kvManagerConfig = { 57e41f4b71Sopenharmony_ci context: context, 58e41f4b71Sopenharmony_ci bundleName: 'com.example.datamanagertest', 59e41f4b71Sopenharmony_ci} 60e41f4b71Sopenharmony_citry { 61e41f4b71Sopenharmony_ci kvManager = distributedKVStore.createKVManager(kvManagerConfig); 62e41f4b71Sopenharmony_ci} catch (e) { 63e41f4b71Sopenharmony_ci console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`); 64e41f4b71Sopenharmony_ci} 65e41f4b71Sopenharmony_ci``` 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ci## cl.distributeddatamgr.2 Move of getRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts 68e41f4b71Sopenharmony_ciMoved **getRdbStoreV9()** from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts, and renamed it **getRdbStore()**. 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci**Change Impact** 71e41f4b71Sopenharmony_ciThe change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ci**Key API/Component Changes** 74e41f4b71Sopenharmony_ciAPIs: 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci```ts 77e41f4b71Sopenharmony_cifunction getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback<RdbStoreV9>): void; 78e41f4b71Sopenharmony_cifunction getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise<RdbStoreV9>; 79e41f4b71Sopenharmony_ci``` 80e41f4b71Sopenharmony_ciMoved the above APIs from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. 81e41f4b71Sopenharmony_ci``` 82e41f4b71Sopenharmony_cifunction getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback<RdbStore>): void; 83e41f4b71Sopenharmony_cifunction getRdbStore(context: Context, config: StoreConfig): Promise<RdbStore>; 84e41f4b71Sopenharmony_ci``` 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci**Adaptation Guide** 87e41f4b71Sopenharmony_ci * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. 88e41f4b71Sopenharmony_ci * Change the names of the **getRdbStore()** APIs. 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ci## cl.distributeddatamgr.3 Move of deleteRdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ciMoved **deleteRdbStoreV9()** from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts, and renamed it **deleteRdbStore()**. 93e41f4b71Sopenharmony_ci 94e41f4b71Sopenharmony_ci**Change Impact** 95e41f4b71Sopenharmony_ciThe change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ci**Key API/Component Changes** 98e41f4b71Sopenharmony_ciAPIs: 99e41f4b71Sopenharmony_ci```ts 100e41f4b71Sopenharmony_cifunction deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback<void>): void; 101e41f4b71Sopenharmony_cifunction deleteRdbStoreV9(context: Context, name: string): Promise<void>; 102e41f4b71Sopenharmony_ci``` 103e41f4b71Sopenharmony_ciMoved the above APIs from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. 104e41f4b71Sopenharmony_ci``` 105e41f4b71Sopenharmony_cifunction deleteRdbStore(context: Context, name: string, callback: AsyncCallback<void>): void; 106e41f4b71Sopenharmony_cifunction deleteRdbStore(context: Context, name: string): Promise<void>; 107e41f4b71Sopenharmony_ci``` 108e41f4b71Sopenharmony_ci 109e41f4b71Sopenharmony_ci**Adaptation Guide** 110e41f4b71Sopenharmony_ci * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. 111e41f4b71Sopenharmony_ci * Change the names of the **deleteRdbStoreV9()** APIs. 112e41f4b71Sopenharmony_ci 113e41f4b71Sopenharmony_ci## cl.distributeddatamgr.4 Move of StoreConfigV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts 114e41f4b71Sopenharmony_ci**Change Impact** 115e41f4b71Sopenharmony_ciThe change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. 116e41f4b71Sopenharmony_ci 117e41f4b71Sopenharmony_ci**Key API/Component Changes** 118e41f4b71Sopenharmony_ciMoved **StoreConfigV9** from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **StoreConfig**. 119e41f4b71Sopenharmony_ci 120e41f4b71Sopenharmony_ci**Adaptation Guide** 121e41f4b71Sopenharmony_ci 122e41f4b71Sopenharmony_ci * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. 123e41f4b71Sopenharmony_ci * Change the **StoreConfigV9** in APIs. 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci## cl.distributeddatamgr.5 Move of enum SecurityLevel from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts 126e41f4b71Sopenharmony_ci**Change Impact** 127e41f4b71Sopenharmony_ciThe change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci**Key API/Component Changes** 130e41f4b71Sopenharmony_ciMoved **enum SecurityLevel** from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts**. 131e41f4b71Sopenharmony_ci 132e41f4b71Sopenharmony_ci**Adaptation Guide** 133e41f4b71Sopenharmony_ci 134e41f4b71Sopenharmony_ciChange **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. 135e41f4b71Sopenharmony_ci 136e41f4b71Sopenharmony_ci## cl.distributeddatamgr.6 Mover of RdbStoreV9 from @ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts 137e41f4b71Sopenharmony_ci**Change Impact** 138e41f4b71Sopenharmony_ciThe change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. 139e41f4b71Sopenharmony_ci 140e41f4b71Sopenharmony_ci**Key API/Component Changes** 141e41f4b71Sopenharmony_ciMoved **RdbStoreV9** from **@ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **RdbStore**. 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ci**Adaptation Guide** 144e41f4b71Sopenharmony_ci * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. 145e41f4b71Sopenharmony_ci * Change **RdbStoreV9** in relevant APIs. 146e41f4b71Sopenharmony_ci 147e41f4b71Sopenharmony_ci## cl.distributeddatamgr.7 Move of class RdbPredicatesV9 from ohos.data.rdb.d.ts to @ohos.data.relationalStore.d.ts 148e41f4b71Sopenharmony_ci**Change Impact** 149e41f4b71Sopenharmony_ciThe change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. 150e41f4b71Sopenharmony_ci 151e41f4b71Sopenharmony_ci**Key API/Component Changes** 152e41f4b71Sopenharmony_ciMoved the class **RdbPredicatesV9** from **ohos.data.rdb.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **RdbPredicates**. 153e41f4b71Sopenharmony_ci 154e41f4b71Sopenharmony_ci**Adaptation Guide** 155e41f4b71Sopenharmony_ci * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. 156e41f4b71Sopenharmony_ci * Change **RdbPredicatesV9** in the relevant APIs. 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ci## cl.distributeddatamgr.8 Move of ResultSetV9 from api/@ohos.data.relationalStore.d.ts to @ohos.data.relationalStore.d.ts 159e41f4b71Sopenharmony_ci**Change Impact** 160e41f4b71Sopenharmony_ciThe change must be made for all the applications that use these APIs. Otherwise, the compilation in the SDK of the new version cannot be successful. 161e41f4b71Sopenharmony_ci 162e41f4b71Sopenharmony_ci**Key API/Component Changes** 163e41f4b71Sopenharmony_ciMoved **ResultSetV9** from **api/data/rdb/resultSet.d.ts** to **@ohos.data.relationalStore.d.ts** and renamed it **ResultSet**. 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ci**Adaptation Guide** 166e41f4b71Sopenharmony_ci * Change **import rdb from "@ohos.data.rdb"** to **import rdb from "@ohos.data.relationalStore"**. 167e41f4b71Sopenharmony_ci * Obtain the **ResultSetV9** instance only by using **getRdbStoreV9**. After modifications are made according to cl.distributeddatamgr.2, the code can automatically adapt to **ResultSet**. 168e41f4b71Sopenharmony_ci 169