From bb918b22cbbf2852a93a53f26054636bdc40abb1 Mon Sep 17 00:00:00 2001 From: wuyongning Date: Mon, 11 Apr 2022 16:13:17 +0800 Subject: [PATCH 1/6] add two interfaces: backup,restore Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index f49a6db5ce..fb0d497051 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -275,6 +275,31 @@ declare namespace rdb { * @param observer Indicates the data change observer already registered . */ off(event:'dataChange', type: SubscribeType, observer: Callback>): void; + + /** + * Back up the database to the specified path. + * + * @note N/A + * @since 8 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param databasePath Indicates the backup path of the database. + * @return Returns 0 if the back up operation is successfull. + */ + backup(databasePath:string, callback: AsyncCallback):void; + backup(databasePath:string): Promise; + + /** + * Restore the database backup file to the specified path. + * + * @note N/A + * @since 8 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param newPath Indicates the path to which the database backup files are to be restored. + * @param backupPath Indicates the backup path of the database. + * @return Returns 0 if the back up operation is successfull. + */ + ChangeDbFileForRestore(newPath:string, backupPath:string, callback: AsyncCallback):void; + ChangeDbFileForRestore(newPath:string, backupPath:string): Promise; } /** -- Gitee From f0cf82f61b20989029ed7ae9e9a4914a0657f287 Mon Sep 17 00:00:00 2001 From: wuyongning Date: Mon, 11 Apr 2022 16:30:51 +0800 Subject: [PATCH 2/6] update Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index fb0d497051..aafe95b267 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -298,8 +298,8 @@ declare namespace rdb { * @param backupPath Indicates the backup path of the database. * @return Returns 0 if the back up operation is successfull. */ - ChangeDbFileForRestore(newPath:string, backupPath:string, callback: AsyncCallback):void; - ChangeDbFileForRestore(newPath:string, backupPath:string): Promise; + restore(newPath:string, backupPath:string, callback: AsyncCallback):void; + restore(newPath:string, backupPath:string): Promise; } /** -- Gitee From 7ce80fd49cb8ed5949fd01e6f95adf3bf1dc16a8 Mon Sep 17 00:00:00 2001 From: wuyongning Date: Tue, 12 Apr 2022 14:03:05 +0800 Subject: [PATCH 3/6] update Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index aafe95b267..38d38926ad 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -296,7 +296,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param newPath Indicates the path to which the database backup files are to be restored. * @param backupPath Indicates the backup path of the database. - * @return Returns 0 if the back up operation is successfull. + * @return Returns 0 if the restore operation is successfull. */ restore(newPath:string, backupPath:string, callback: AsyncCallback):void; restore(newPath:string, backupPath:string): Promise; -- Gitee From ab6033e06906d09cd8280469fc0569aa6f3f6c82 Mon Sep 17 00:00:00 2001 From: wuyongning Date: Wed, 13 Apr 2022 09:39:24 +0800 Subject: [PATCH 4/6] update Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 38d38926ad..1bec942d6b 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -280,7 +280,7 @@ declare namespace rdb { * Back up the database to the specified path. * * @note N/A - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param databasePath Indicates the backup path of the database. * @return Returns 0 if the back up operation is successfull. @@ -292,7 +292,7 @@ declare namespace rdb { * Restore the database backup file to the specified path. * * @note N/A - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param newPath Indicates the path to which the database backup files are to be restored. * @param backupPath Indicates the backup path of the database. -- Gitee From f7521fa38b6878b0ee0fd1581047fefc2ca37bee Mon Sep 17 00:00:00 2001 From: wuyongning Date: Thu, 14 Apr 2022 15:15:55 +0800 Subject: [PATCH 5/6] update Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 1bec942d6b..2e2703195d 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -283,10 +283,9 @@ declare namespace rdb { * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param databasePath Indicates the backup path of the database. - * @return Returns 0 if the back up operation is successfull. */ - backup(databasePath:string, callback: AsyncCallback):void; - backup(databasePath:string): Promise; + backup(databasePath:string, callback: AsyncCallback):void; + backup(databasePath:string): Promise; /** * Restore the database backup file to the specified path. @@ -296,10 +295,9 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param newPath Indicates the path to which the database backup files are to be restored. * @param backupPath Indicates the backup path of the database. - * @return Returns 0 if the restore operation is successfull. */ - restore(newPath:string, backupPath:string, callback: AsyncCallback):void; - restore(newPath:string, backupPath:string): Promise; + restore(newPath:string, backupPath:string, callback: AsyncCallback):void; + restore(newPath:string, backupPath:string): Promise; } /** -- Gitee From 0de675fe92f08bb3e9e4fba152ecf3522b3baf6c Mon Sep 17 00:00:00 2001 From: wuyongning Date: Thu, 5 May 2022 15:08:49 +0800 Subject: [PATCH 6/6] update file Signed-off-by: wuyongning --- api/@ohos.data.rdb.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 2e2703195d..565969342c 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -277,24 +277,24 @@ declare namespace rdb { off(event:'dataChange', type: SubscribeType, observer: Callback>): void; /** - * Back up the database to the specified path. + * Backup the database. * * @note N/A * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param databasePath Indicates the backup path of the database. + * @param databasePath Indicates the backup name of the database. */ backup(databasePath:string, callback: AsyncCallback):void; backup(databasePath:string): Promise; /** - * Restore the database backup file to the specified path. + * Restore the database. * * @note N/A * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param newPath Indicates the path to which the database backup files are to be restored. - * @param backupPath Indicates the backup path of the database. + * @param newPath Indicates the restore name when the database restored. + * @param backupPath Indicates the backup name of the database. */ restore(newPath:string, backupPath:string, callback: AsyncCallback):void; restore(newPath:string, backupPath:string): Promise; -- Gitee