提交 6973367f 编写于 作者: G ge-yafang

update docs

Signed-off-by: Nge-yafang <geyafang@huawei.com>
上级 219d193e
......@@ -1689,115 +1689,6 @@ off(event:'dataChange', type: SubscribeType, observer: Callback&lt;Array&lt;stri
}
```
### backup<sup>9+</sup>
backup(databasePath:string, callback: AsyncCallback&lt;void&gt;):void
备份数据库,结果以callback形式返回。
**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| ------------ | ------------------------- | ---- | ------------------------ |
| databasePath | string | 是 | 表示数据库的备份文件名。 |
| callback | AsyncCallback&lt;void&gt; | 是 | callback回调函数。 |
**示例**
```ts
rdbStore.backup("backup001.db", function (err) {
if (err) {
console.info('backup failed.')
return
}
console.info('backup success.')
})
```
### backup<sup>9+</sup>
backup(databasePath:string): Promise&lt;void&gt;
备份数据库,结果以Promise形式返回。
**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| ------------ | ------ | ---- | ------------------------ |
| databasePath | string | 是 | 表示数据库的备份文件名。 |
**返回值**
| 类型 | 说明 |
| ------------------- | ----------------- |
| Promise&lt;void&gt; | Promise回调函数。 |
**示例**
```ts
let promiseBackup = rdbStore.backup("backup001.db")
promiseBackup.then(() => {
console.info("backup success.")
}).catch((err) => {
console.info("backup failed.")
})
```
### restore<sup>9+</sup>
restore(newPath:string, backupPath:string, callback: AsyncCallback&lt;void&gt;):void
恢复数据库,结果以callback形式返回。
**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------- | ---- | -------------------------- |
| newPath | string | 是 | 表示数据库恢复后的文件名。 |
| backupPath | string | 是 | 表示数据库的备份文件名。 |
| callback | AsyncCallback&lt;void&gt; | 是 | callback回调函数。 |
**示例**
```ts
rdbStore.restore("restore001.db", "backup001.db", function (err) {
if (err) {
console.info('restore failed.')
return
}
console.info('restore success.')
})
```
### restore<sup>9+</sup>
restore(newPath:string, backupPath:string): Promise&lt;void&gt;
恢复数据库,结果以Promise形式返回。
**系统能力**:SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------ | ---- | -------------------------- |
| newPath | string | 是 | 表示数据库恢复后的文件名。 |
| backupPath | string | 是 | 表示数据库的备份文件名。 |
**返回值**
| 类型 | 说明 |
| ------------------- | ----------------- |
| Promise&lt;void&gt; | Promise回调函数。 |
**示例**
```ts
let promiseRestore = rdbStore.restore("restore001.db", "backup001.db")
promiseRestore.then(() => {
console.info("restore success.")
}).catch((err) => {
console.info("restore failed.")
})
```
## StoreConfig
管理关系数据库配置。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册