From 27cad78e7f635d0320521688b839678c19066cab Mon Sep 17 00:00:00 2001 From: wuyongning Date: Fri, 10 Jun 2022 09:48:51 +0800 Subject: [PATCH 1/2] add backup/restore interfaces Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index ebb6a1bc90..0e553aa2a9 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -237,6 +237,26 @@ declare namespace rdb { */ rollBack():void; + /** + * Backs up a database in a specified name. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param destName Indicates the name that saves the database backup. + */ + backup(destName:string, callback: AsyncCallback):void; + backup(destName:string): Promise; + + /** + * Restores a database from a specified database file. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param srcName Indicates the name that saves the database file. + */ + restore(srcName:string, callback: AsyncCallback):void; + restore(srcName:string): Promise; + /** * Set table to be distributed table. * -- Gitee From dbd345c7c5547917066eff4a1a5a16bc25f4a1db Mon Sep 17 00:00:00 2001 From: wuyongning Date: Fri, 10 Jun 2022 09:50:19 +0800 Subject: [PATCH 2/2] update format Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 0e553aa2a9..b0b92f6f14 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -246,14 +246,14 @@ declare namespace rdb { */ backup(destName:string, callback: AsyncCallback):void; backup(destName:string): Promise; - - /** - * Restores a database from a specified database file. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param srcName Indicates the name that saves the database file. - */ + + /** + * Restores a database from a specified database file. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param srcName Indicates the name that saves the database file. + */ restore(srcName:string, callback: AsyncCallback):void; restore(srcName:string): Promise; -- Gitee