Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
7733302e
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,发现更多精彩内容 >>
提交
7733302e
编写于
4月 11, 2023
作者:
L
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
security
Signed-off-by:
N
lihuihui
<
lihuihui29@huawei.com
>
上级
4f4389d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
13 deletion
+23
-13
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
+7
-5
zh-cn/application-dev/reference/apis/js-apis-data-relationalStore.md
...cation-dev/reference/apis/js-apis-data-relationalStore.md
+16
-8
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
浏览文件 @
7733302e
...
...
@@ -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
;
}
...
...
@@ -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
浏览文件 @
7733302e
...
...
@@ -317,6 +317,10 @@ class EntryAbility extends UIAbility {
数据库的安全级别枚举。
> **说明:**
>
> 若需要进行同步操作,数据库安全等级应低于对端设备安全等级。
**系统能力:**
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
;
}
...
...
@@ -2048,6 +2052,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
)
{
...
...
@@ -2056,7 +2061,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
'
);
...
...
@@ -2105,6 +2110,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
)
{
...
...
@@ -2113,12 +2119,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
}
`
);
...
...
@@ -2564,6 +2570,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
)
{
...
...
@@ -2572,7 +2579,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
)
{
...
...
@@ -2616,6 +2623,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
)
{
...
...
@@ -2624,7 +2632,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
"
);
...
...
@@ -2658,6 +2666,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
)
{
...
...
@@ -2666,7 +2675,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
;
}
...
...
@@ -2714,6 +2722,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
)
{
...
...
@@ -2722,7 +2731,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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录