Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
75ceea51
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看板
未验证
提交
75ceea51
编写于
2月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1495 增加系统能力
Merge pull request !1495 from wellinleo/master
上级
7a73c3a2
aa994dc7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
67 addition
and
69 deletion
+67
-69
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
+3
-1
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
+3
-1
zh-cn/application-dev/reference/apis/js-apis-data-resultset.md
.../application-dev/reference/apis/js-apis-data-resultset.md
+31
-37
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
+27
-30
zh-cn/application-dev/reference/apis/js-apis-distributed-data.md
...pplication-dev/reference/apis/js-apis-distributed-data.md
+3
-0
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
浏览文件 @
75ceea51
...
...
@@ -10,6 +10,8 @@
import dataAbility from '@ohos.data.dataAbility'
```
## 系统能力
SystemCapability.DistributedDataManager.DataShare.Consumer
## 权限
...
...
@@ -622,7 +624,7 @@ distinct(): DataAbilityPredicates
```
let predicates = new dataAbility.DataAbilityPredicates("EMPLOYEE")
predicates.equalTo("NAME", "Rose").distinct("NAME")
rdbStore.query(predicates, ["NAME"])
let resultSet = await
rdbStore.query(predicates, ["NAME"])
```
...
...
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
浏览文件 @
75ceea51
...
...
@@ -3,6 +3,8 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 系统能力
SystemCapability.DistributedDataManager.RelationalStore.Core
## 导入模块
...
...
@@ -709,7 +711,7 @@ distinct(): RdbPredicates
```
let predicates = new data_rdb.RdbPredicates("EMPLOYEE")
predicates.equalTo("NAME", "Rose").distinct("NAME")
rdbStore.query(predicates, ["NAME"])
let resultSet = await
rdbStore.query(predicates, ["NAME"])
```
...
...
zh-cn/application-dev/reference/apis/js-apis-data-resultset.md
浏览文件 @
75ceea51
...
...
@@ -3,6 +3,8 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 系统能力
SystemCapability.DistributedDataManager.RelationalStore.Core
## 使用说明
...
...
@@ -14,9 +16,8 @@ let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
predicates.equalTo("AGE", 18)
let promise = rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
promise.then((resultSet) => {
console.log("resultSet columnNames:" + resultSet.columnNames);
console.log("resultSet columnCount:" + resultSet.columnCount);
})
await console.log(TAG + "resultSet columnNames:" + resultSet.columnNames);
await console.log(TAG + "resultSet columnCount:" + resultSet.columnCount);})
```
...
...
@@ -115,11 +116,10 @@ goTo(offset:number): boolean
-
示例:
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goTo(1);
resultSet.close();
resultSet = null;
})
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goTo(1)
resultSet.close()
resultSet = null
```
...
...
@@ -142,11 +142,10 @@ goToRow(position: number): boolean
-
示例:
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToRow(1);
resultSet.close();
resultSet = null
})
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToRow(1)
resultSet.close()
resultSet = null
```
...
...
@@ -166,11 +165,10 @@ goToFirstRow(): boolean
-
示例:
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToFirstRow();
resultSet.close();
resultSet = null;
})
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToFirstRow()
resultSet.close()
resultSet = null;
```
...
...
@@ -188,11 +186,10 @@ goToLastRow(): boolean
-
示例:
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToLastRow();
resultSet.close();
resultSet = null;
})
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToLastRow()
resultSet.close()
resultSet = null;
```
...
...
@@ -210,11 +207,10 @@ goToNextRow(): boolean
-
示例:
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToNextRow()
resultSet.close()
resultSet = null;
})
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToNextRow()
resultSet.close()
resultSet = null;
```
...
...
@@ -232,11 +228,10 @@ goToPreviousRow(): boolean
-
示例:
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.goToPreviousRow();
resultSet.close();
resultSet = null
})
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.goToPreviousRow()
resultSet.close()
resultSet = null
```
...
...
@@ -360,8 +355,7 @@ close(): void
-
示例:
```
let predicates = new dataRdb.RdbPredicates("EMPLOYEE")
rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]).then((resultSet) => {
resultSet.close();
resultSet = null
})
let resultSet = await rdbStore.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"])
resultSet.close()
resultSet = null
```
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
浏览文件 @
75ceea51
...
...
@@ -13,6 +13,9 @@
import dataStorage from '@ohos.data.storage'
```
## 系统能力
SystemCapability.DistributedDataManager.Preference.Core
## 权限
...
...
@@ -48,13 +51,11 @@ getStorageSync(path: string): Storage
import dataStorage from '@ohos.data.storage'
import featureAbility from '@ohos.ability.featureAbility'
(async () => {
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let storage = dataStorage.getStorageSync(path + '/mystore')
storage.putSync('startup', 'auto')
storage.flushSync()
})()
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let storage = dataStorage.getStorageSync(path + '/mystore')
storage.putSync('startup', 'auto')
storage.flushSync()
```
...
...
@@ -75,18 +76,16 @@ getStorage(path: string, callback: AsyncCallback<Storage>): void
import dataStorage from '@ohos.data.storage'
import featureAbility from '@ohos.ability.featureAbility'
(async () => {
var context = featureAbility.getContext()
var path = await context.getFilesDir()
dataStorage.getStorage(path + '/mystore', function (err, storage) {
if (err) {
console.info("Get the storage failed, path: " + path + '/mystore')
return;
}
storage.putSync('startup', 'auto')
storage.flushSync()
})
})()
var context = featureAbility.getContext()
var path = await context.getFilesDir()
dataStorage.getStorage(path + '/mystore', function (err, storage) {
if (err) {
console.info("Get the storage failed, path: " + path + '/mystore')
return;
}
storage.putSync('startup', 'auto')
storage.flushSync()
})
```
...
...
@@ -111,17 +110,15 @@ getStorage(path: string): Promise<Storage>
import dataStorage from '@ohos.data.storage'
import featureAbility from '@ohos.ability.featureAbility'
(async () => {
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let promise = dataStorage.getStorage(path + '/mystore')
promise.then((storage) => {
storage.putSync('startup', 'auto')
storage.flushSync()
}).catch((err) => {
console.info("Get the storage failed, path: " + path + '/mystore')
})
}()
var context = featureAbility.getContext()
var path = await context.getFilesDir()
let promise = dataStorage.getStorage(path + '/mystore')
promise.then((storage) => {
storage.putSync('startup', 'auto')
storage.flushSync()
}).catch((err) => {
console.info("Get the storage failed, path: " + path + '/mystore')
})
```
...
...
zh-cn/application-dev/reference/apis/js-apis-distributed-data.md
浏览文件 @
75ceea51
...
...
@@ -3,6 +3,9 @@
>![](../../public_sys-resources/icon-note.gif) **说明:**
>本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 系统能力
SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
## 导入模块<a name="s56d19203690d4782bfc74069abb6bd71"></a>
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录