提交 8dab1671 编写于 作者: L lihuihui

rdb

Signed-off-by: Nlihuihui <lihuihui29@huawei.com>
上级 d7fedd6a
...@@ -44,7 +44,7 @@ getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback&lt;Rd ...@@ -44,7 +44,7 @@ getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback&lt;Rd
| 14800011 | Failed to open database by database corrupted. | | 14800011 | Failed to open database by database corrupted. |
| 14800000 | Inner error. | | 14800000 | Inner error. |
| 14801001 | Only supported in Stage mode. | | 14801001 | Only supported in Stage mode. |
| 14801002 | The dataGroupId not valid. | | 14801002 | The dataGroupId is not valid. |
**示例:** **示例:**
...@@ -130,7 +130,7 @@ getRdbStore(context: Context, config: StoreConfig): Promise&lt;RdbStore&gt; ...@@ -130,7 +130,7 @@ getRdbStore(context: Context, config: StoreConfig): Promise&lt;RdbStore&gt;
| 14800011 | Failed to open database by database corrupted. | | 14800011 | Failed to open database by database corrupted. |
| 14800000 | Inner error. | | 14800000 | Inner error. |
| 14801001 | Only supported in Stage mode. | | 14801001 | Only supported in Stage mode. |
| 14801002 | The dataGroupId not valid. | | 14801002 | The dataGroupId is not valid. |
**示例:** **示例:**
...@@ -245,11 +245,13 @@ class EntryAbility extends UIAbility { ...@@ -245,11 +245,13 @@ class EntryAbility extends UIAbility {
} }
``` ```
## relationalStore.deleteRdbStore ## relationalStore.deleteRdbStore<sup>10+</sup>
function deleteRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback<void>): void; deleteRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback<void>): void
删除数据库,使用callback异步回调。 使用指定的数据库文件配置删除数据库,使用callback异步回调。若数据库文件处于公共沙箱目录下,删除数据库时必须使用该接口。
当在公共沙箱目录下创建数据库时,必需使用该接口删除数据库。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core **系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
...@@ -270,7 +272,7 @@ function deleteRdbStore(context: Context, config: StoreConfig, callback: AsyncCa ...@@ -270,7 +272,7 @@ function deleteRdbStore(context: Context, config: StoreConfig, callback: AsyncCa
| 14800010 | Failed to open or delete database by invalid database path. | | 14800010 | Failed to open or delete database by invalid database path. |
| 14800000 | Inner error. | | 14800000 | Inner error. |
| 14801001 | Only supported in Stage mode. | | 14801001 | Only supported in Stage mode. |
| 14801002 | The dataGroupId not valid. | | 14801002 | The dataGroupId is not valid. |
**示例:** **示例:**
...@@ -382,11 +384,11 @@ class EntryAbility extends UIAbility { ...@@ -382,11 +384,11 @@ class EntryAbility extends UIAbility {
} }
``` ```
## relationalStore.deleteRdbStore ## relationalStore.deleteRdbStore<sup>10+</sup>
deleteRdbStore(context: Context, config: StoreConfig): Promise<void>; deleteRdbStore(context: Context, config: StoreConfig): Promise<void>
使用指定的数据库文件配置删除数据库,使用Promise异步回调。 使用指定的数据库文件配置删除数据库,使用Promise异步回调。若数据库文件处于公共沙箱目录下,删除数据库时必须使用该接口。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core **系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
...@@ -412,7 +414,7 @@ deleteRdbStore(context: Context, config: StoreConfig): Promise<void>; ...@@ -412,7 +414,7 @@ deleteRdbStore(context: Context, config: StoreConfig): Promise<void>;
| 14800010 | Failed to open or delete database by invalid database path. | | 14800010 | Failed to open or delete database by invalid database path. |
| 14800000 | Inner error. | | 14800000 | Inner error. |
| 14801001 | Only supported in Stage mode. | | 14801001 | Only supported in Stage mode. |
| 14801002 | The dataGroupId not valid. | | 14801002 | The dataGroupId is not valid. |
**示例:** **示例:**
...@@ -468,7 +470,7 @@ class EntryAbility extends UIAbility { ...@@ -468,7 +470,7 @@ class EntryAbility extends UIAbility {
| name | string | 是 | 数据库文件名。 | | name | string | 是 | 数据库文件名。 |
| securityLevel | [SecurityLevel](#securitylevel) | 是 | 设置数据库安全级别 | | securityLevel | [SecurityLevel](#securitylevel) | 是 | 设置数据库安全级别 |
| encrypt | boolean | 否 | 指定数据库是否加密,默认不加密。<br/> true:加密。<br/> false:非加密。 | | encrypt | boolean | 否 | 指定数据库是否加密,默认不加密。<br/> true:加密。<br/> false:非加密。 |
| dataGroupId | string | 否 | 应用组ID。<br/>**模型约束:** 此属性仅可在Stage模型下可用。 | | dataGroupId<sup>10+</sup> | string | 否 | 应用组ID。<br/>**模型约束:** 此属性仅可在Stage模式下可用。<br/>从API version 10开始,支持此可选参数。当此参数不填时,默认在本应用沙箱目录下创建数据库。 |
## SecurityLevel ## SecurityLevel
...@@ -3930,7 +3932,7 @@ try { ...@@ -3930,7 +3932,7 @@ try {
### on<sup>10+</sup> ### on<sup>10+</sup>
on(event: string, supportShared: boolean, observer: Callback): void; on(event: string, supportShared: boolean, observer: Callback): void
注册数据库的数据变更的事件监听。当调用[emit](#emit10)接口时,将调用回调。 注册数据库的数据变更的事件监听。当调用[emit](#emit10)接口时,将调用回调。
...@@ -3941,7 +3943,7 @@ on(event: string, supportShared: boolean, observer: Callback): void; ...@@ -3941,7 +3943,7 @@ on(event: string, supportShared: boolean, observer: Callback): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------------- | -------- | ---- | ------------------------------------------------------------ | | ------------- | -------- | ---- | ------------------------------------------------------------ |
| event | string | 是 | 订阅事件名称。 | | event | string | 是 | 订阅事件名称。 |
| supportShared | boolean | 是 | 指定是进程间还是本进程订阅。<br/> true:进程间。<br/> false:本进程。 | | supportShared | boolean | 是 | 指定是进程间还是本进程订阅。<br/> true:进程间。<br/> false:本进程。 |
| observer | Callback | 是 | 回调函数。 | | observer | Callback | 是 | 回调函数。 |
**错误码:** **错误码:**
...@@ -4031,7 +4033,7 @@ try { ...@@ -4031,7 +4033,7 @@ try {
### off<sup>10+</sup> ### off<sup>10+</sup>
off(event: string, supportShared: boolean, observer?: Callback<void>): void; off(event: string, supportShared: boolean, observer?: Callback<void>): void
取消数据变更的事件监听。 取消数据变更的事件监听。
...@@ -4042,7 +4044,7 @@ off(event: string, supportShared: boolean, observer?: Callback<void>): void; ...@@ -4042,7 +4044,7 @@ off(event: string, supportShared: boolean, observer?: Callback<void>): void;
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------------- | -------- | ---- | ------------------------------------------------------------ | | ------------- | -------- | ---- | ------------------------------------------------------------ |
| event | string | 是 | 取消订阅事件名称。 | | event | string | 是 | 取消订阅事件名称。 |
| supportShared | boolean | 是 | 指定是进程间还是本进程取消订阅。<br/> true:进程间。<br/> false:本进程。 | | supportShared | boolean | 是 | 指定是进程间还是本进程取消订阅。<br/> true:进程间。<br/> false:本进程。 |
| observer | Callback | 否 | 该参数存在,则取消指定Callback监听回调,否则取消该event事件的所有监听回调。 | | observer | Callback | 否 | 该参数存在,则取消指定Callback监听回调,否则取消该event事件的所有监听回调。 |
**错误码:** **错误码:**
...@@ -4070,9 +4072,9 @@ try { ...@@ -4070,9 +4072,9 @@ try {
### emit<sup>10+</sup> ### emit<sup>10+</sup>
emit(event: string): void; emit(event: string): void
通知数据变更的事件监听 通知通过[on](#on10)注册的进程间或者进程内监听事件
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core **系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
...@@ -4088,14 +4090,13 @@ emit(event: string): void; ...@@ -4088,14 +4090,13 @@ emit(event: string): void;
| **错误码ID** | **错误信息** | | **错误码ID** | **错误信息** |
| ------------ | -------------------------------------- | | ------------ | -------------------------------------- |
| 801 | Capability not supported. |
| 14800000 | Inner error. | | 14800000 | Inner error. |
| 14800050 | Failed to obtain subscription service. | | 14800050 | Failed to obtain subscription service. |
**示例:** **示例:**
```js ```js
store.emit(storeObserver); store.emit('storeObserver');
``` ```
## ResultSet ## ResultSet
......
...@@ -116,59 +116,61 @@ WAL文件大小超过默认上限(200M)。 ...@@ -116,59 +116,61 @@ WAL文件大小超过默认上限(200M)。
**处理步骤** **处理步骤**
1. 检查结果集或者事务是否未关闭。 检查结果集或者事务是否未关闭。
2. 关闭所有的结果集或者事务。
## 14801001 上下文环境非Stage模式 关闭所有的结果集或者事务。
## 14800050 获取订阅服务失败
**错误信息** **错误信息**
Only supported in Stage mode. Failed to obtain subscription service.
**错误描述** **错误描述**
该操作仅支持Stage模式 进行进程间订阅时,获取订阅服务失败
**可能原因** **可能原因**
当前上下文环境非Stage模式,比如FA模式 服务端出现异常
**处理步骤** **处理步骤**
1. 使用Stage模式 需通过日志信息确认错误发生原因
## 14801002 storeConfig中传入的dataGroupId参数非法 ## 14801001 上下文环境非Stage模式
**错误信息** **错误信息**
The dataGroupId not valid. Only supported in Stage mode.
**错误描述** **错误描述**
使用非法dataGroupId参数 该操作仅支持Stage模式
**可能原因** **可能原因**
使用的dataGroupId不是从应用市场正常申请的 当前上下文环境非Stage模式,比如FA模式
**处理步骤** **处理步骤**
1. 应用从应用市场申请dataGroupId,并正确传入该参数 请切换当前上下文环境,使用Stage模式
## 801 能力不支持 ## 14801002 storeConfig中传入的dataGroupId参数非法
**错误信息** **错误信息**
Capability not supported. The dataGroupId not valid.
**错误描述** **错误描述**
能力不支持 使用非法dataGroupId参数
**可能原因** **可能原因**
在跨平台上使用了某些不支持跨平台的接口 使用的dataGroupId不是从应用市场正常申请的
**处理步骤** **处理步骤**
1. 使用其他功能相同的接口。 应用从应用市场申请dataGroupId,并正确传入该参数。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册