Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
50950424
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
50950424
编写于
4月 14, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 14, 2023
浏览文件
操作
浏览文件
下载
差异文件
!17181 RDB安全等级文档优化
Merge pull request !17181 from lihuihui/master
上级
c09d44b3
e24c7631
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
15 deletion
+25
-15
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
+8
-6
zh-cn/application-dev/reference/apis/js-apis-data-relationalStore.md
...cation-dev/reference/apis/js-apis-data-relationalStore.md
+17
-9
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
浏览文件 @
50950424
...
...
@@ -372,6 +372,7 @@ inDevices(devices: Array<string>): RdbPredicates
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceIds
=
[];
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -380,7 +381,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceIds
=
[];
for
(
var
i
=
0
;
i
<
devices
.
length
;
i
++
)
{
deviceIds
[
i
]
=
devices
[
i
].
deviceId
;
}
...
...
@@ -1174,7 +1174,7 @@ predicates.notIn("NAME", ["Lisa", "Rose"])
提供管理关系数据库(RDB)方法的接口。
在使用以下相关接口前,请使用
[
executeSql
](
#executesql8
)
接口初始化数据库表结构和相关数据
,具体可见
[
关系型数据库开发指导
](
../../database/database-relational-guidelines.md
)
。
在使用以下相关接口前,请使用
[
executeSql
](
#executesql8
)
接口初始化数据库表结构和相关数据。
### insert
...
...
@@ -1851,6 +1851,7 @@ obtainDistributedTableName(device: string, table: string, callback: AsyncCallbac
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceId
=
null
;
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -1859,7 +1860,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceId
=
devices
[
0
].
deviceId
;
deviceId
=
devices
[
0
].
deviceId
;
})
...
...
@@ -1904,6 +1905,7 @@ rdbStore.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableNa
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceId
=
null
;
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -1912,7 +1914,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceId
=
devices
[
0
].
deviceId
;
deviceId
=
devices
[
0
].
deviceId
;
})
let
promise
=
rdbStore
.
obtainDistributedTableName
(
deviceId
,
"
EMPLOYEE
"
)
...
...
@@ -1946,6 +1948,7 @@ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback<Array
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceIds
=
[];
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -1954,7 +1957,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceIds
=
[];
for
(
var
i
=
0
;
i
<
devices
.
length
;
i
++
)
{
deviceIds
[
i
]
=
devices
[
i
].
deviceId
;
}
...
...
@@ -2002,6 +2004,7 @@ rdbStore.sync(data_rdb.SyncMode.SYNC_MODE_PUSH, predicates, function (err, resul
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceIds
=
[];
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -2010,7 +2013,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceIds
=
[];
for
(
var
i
=
0
;
i
<
devices
.
length
;
i
++
)
{
deviceIds
[
i
]
=
devices
[
i
].
deviceId
;
}
...
...
zh-cn/application-dev/reference/apis/js-apis-data-relationalStore.md
浏览文件 @
50950424
...
...
@@ -317,6 +317,10 @@ class EntryAbility extends UIAbility {
数据库的安全级别枚举。
> **说明:**
>
> 若需要进行同步操作,数据库安全等级应不高于对端设备安全等级,具体可见[跨设备同步访问控制机制](../../database/sync-app-data-across-devices-overview.md#跨设备同步访问控制机制)。
**系统能力:**
SystemCapability.DistributedDataManager.RelationalStore.Core
| 名称 | 值 | 说明 |
...
...
@@ -439,6 +443,7 @@ inDevices(devices: Array<string>): RdbPredicates
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceIds
=
[];
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -447,7 +452,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceIds
=
[];
for
(
var
i
=
0
;
i
<
devices
.
length
;
i
++
)
{
deviceIds
[
i
]
=
devices
[
i
].
deviceId
;
}
...
...
@@ -1246,7 +1250,7 @@ predicates.notIn("NAME", ["Lisa", "Rose"]);
提供管理关系数据库(RDB)方法的接口。
在使用以下相关接口前,请使用
[
executeSql
](
#executesql
)
接口初始化数据库表结构和相关数据
,具体可见
[
关系型数据库开发指导
](
../../database/database-relational-guidelines.md
)
。
在使用以下相关接口前,请使用
[
executeSql
](
#executesql
)
接口初始化数据库表结构和相关数据。
### 属性<sup>10+</sup>
...
...
@@ -2176,6 +2180,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceId
=
null
;
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -2184,7 +2189,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceId
=
devices
[
0
].
deviceId
;
deviceId
=
devices
[
0
].
deviceId
;
})
let
predicates
=
new
relationalStore
.
RdbPredicates
(
'
EMPLOYEE
'
);
...
...
@@ -2233,6 +2238,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceId
=
null
;
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -2241,12 +2247,12 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceId
=
devices
[
0
].
deviceId
;
deviceId
=
devices
[
0
].
deviceId
;
})
let
predicates
=
new
relationalStore
.
RdbPredicates
(
'
EMPLOYEE
'
);
predicates
.
greaterThan
(
"
id
"
,
0
);
let
promise
=
store
.
remoteQuery
(
"
deviceId
"
,
"
EMPLOYEE
"
,
predicates
,
[
"
ID
"
,
"
NAME
"
,
"
AGE
"
,
"
SALARY
"
,
"
CODES
"
]);
let
promise
=
store
.
remoteQuery
(
deviceId
,
"
EMPLOYEE
"
,
predicates
,
[
"
ID
"
,
"
NAME
"
,
"
AGE
"
,
"
SALARY
"
,
"
CODES
"
]);
promise
.
then
((
resultSet
)
=>
{
console
.
info
(
`ResultSet column names:
${
resultSet
.
columnNames
}
`
);
console
.
info
(
`ResultSet column count:
${
resultSet
.
columnCount
}
`
);
...
...
@@ -2716,6 +2722,7 @@ obtainDistributedTableName(device: string, table: string, callback: AsyncCallbac
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceId
=
null
;
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -2724,7 +2731,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceId
=
devices
[
0
].
deviceId
;
deviceId
=
devices
[
0
].
deviceId
;
})
store
.
obtainDistributedTableName
(
deviceId
,
"
EMPLOYEE
"
,
function
(
err
,
tableName
)
{
...
...
@@ -2768,6 +2775,7 @@ store.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableName)
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceId
=
null
;
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -2776,7 +2784,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceId
=
devices
[
0
].
deviceId
;
deviceId
=
devices
[
0
].
deviceId
;
})
let
promise
=
store
.
obtainDistributedTableName
(
deviceId
,
"
EMPLOYEE
"
);
...
...
@@ -2810,6 +2818,7 @@ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback<Array
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceIds
=
[];
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -2818,7 +2827,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceIds
=
[];
for
(
var
i
=
0
;
i
<
devices
.
length
;
i
++
)
{
deviceIds
[
i
]
=
devices
[
i
].
deviceId
;
}
...
...
@@ -2866,6 +2874,7 @@ store.sync(relationalStore.SyncMode.SYNC_MODE_PUSH, predicates, function (err, r
```
js
import
deviceManager
from
'
@ohos.distributedHardware.deviceManager
'
;
let
dmInstance
=
null
;
let
deviceIds
=
[];
deviceManager
.
createDeviceManager
(
"
com.example.appdatamgrverify
"
,
(
err
,
manager
)
=>
{
if
(
err
)
{
...
...
@@ -2874,7 +2883,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance
=
manager
;
let
devices
=
dmInstance
.
getTrustedDeviceListSync
();
let
deviceIds
=
[];
for
(
var
i
=
0
;
i
<
devices
.
length
;
i
++
)
{
deviceIds
[
i
]
=
devices
[
i
].
deviceId
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录