Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
6c0b735b
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看板
提交
6c0b735b
编写于
1月 11, 2023
作者:
A
Annie_wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
Annie_wang
<
annie.wangli@huawei.com
>
上级
8e2fcf0d
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
3603 addition
and
671 deletion
+3603
-671
en/application-dev/reference/apis/Readme-EN.md
en/application-dev/reference/apis/Readme-EN.md
+2
-1
en/application-dev/reference/apis/js-apis-application-dataShareExtensionAbility.md
...nce/apis/js-apis-application-dataShareExtensionAbility.md
+31
-10
en/application-dev/reference/apis/js-apis-data-DataShareResultSet.md
...ion-dev/reference/apis/js-apis-data-DataShareResultSet.md
+1
-1
en/application-dev/reference/apis/js-apis-data-dataShare.md
en/application-dev/reference/apis/js-apis-data-dataShare.md
+219
-113
en/application-dev/reference/apis/js-apis-data-rdb.md
en/application-dev/reference/apis/js-apis-data-rdb.md
+127
-546
en/application-dev/reference/apis/js-apis-data-relationalStore.md
...cation-dev/reference/apis/js-apis-data-relationalStore.md
+3202
-0
en/application-dev/reference/errorcodes/errorcode-datashare.md
...plication-dev/reference/errorcodes/errorcode-datashare.md
+21
-0
未找到文件。
en/application-dev/reference/apis/Readme-EN.md
浏览文件 @
6c0b735b
...
...
@@ -202,7 +202,7 @@
-
[
@ohos.data.distributedDataObject
](
js-apis-data-distributedobject.md
)
-
[
@ohos.data.distributedKVStore
](
js-apis-distributedKVStore.md
)
-
[
@ohos.data.preferences
](
js-apis-data-preferences.md
)
-
[
@ohos.data.r
db
](
js-apis-data-rdb
.md
)
-
[
@ohos.data.r
elationalStore
](
js-apis-data-relationalStore
.md
)
-
[
@ohos.data.ValuesBucket
](
js-apis-data-valuesBucket.md
)
-
data/rdb
-
[
resultSet
](
js-apis-data-resultset.md
)
...
...
@@ -339,6 +339,7 @@
-
[
@ohos.bundleState
](
js-apis-deviceUsageStatistics.md
)
-
[
@ohos.bytrace
](
js-apis-bytrace.md
)
-
[
@ohos.data.storage
](
js-apis-data-storage.md
)
-
[
@ohos.data.rdb
](
js-apis-data-rdb.md
)
-
[
@ohos.data.distributedData
](
js-apis-distributed-data.md
)
-
[
@ohos.distributedBundle
](
js-apis-Bundle-distributedBundle.md
)
-
[
@ohos.document
](
js-apis-document.md
)
...
...
en/application-dev/reference/apis/js-apis-application-dataShareExtensionAbility.md
浏览文件 @
6c0b735b
# @ohos.application.DataShareExtensionAbility
The
**DataShareExtensionAbility**
module provides
extension abilities for data share services
.
The
**DataShareExtensionAbility**
module provides
data share services based on the Extension ability
.
>**NOTE**
>
...
...
@@ -17,6 +17,27 @@ The **DataShareExtensionAbility** module provides extension abilities for data s
import
DataShareExtensionAbility
from
'
@ohos.application.DataShareExtensionAbility
'
```
## URI Naming Rule
The URIs are in the following format:
**Scheme://authority/path**
-
*Scheme*
: scheme name, which has a fixed value of
**datashare**
for the
**DataShare**
module.
-
*authority*
: [userinfo@]host[:port]
-
*userinfo*
: login information, which can be left unspecified.
-
*host*
: server address. It is the target device ID for cross-device access and empty for local device access.
-
*port*
: port number of the server, which can be left unspecified.
-
*path*
:
**DataShare**
identifier and the resource path. The
**DataShare**
identifier is mandatory, and the resource path is optional.
Example:
-
URI without the resource path:
<br>
**datashare:///com.samples.datasharetest.DataShare**
-
URI with the resource path:
<br>
**datashare:///com.samples.datasharetest.DataShare/DB00/TBL00**
**com.samples.datasharetest.DataShare**
is the data share identifier, and
**DB00/TBL00**
is the resource path.
## Attributes
**System capability**
: SystemCapability.DistributedDataManager.DataShare.Provider
...
...
@@ -43,7 +64,7 @@ Called by the server to initialize service logic when the DataShare client conne
**Example**
```
ts
import
rdb
from
'
@ohos.data.r
db
'
;
import
rdb
from
'
@ohos.data.r
elationalStore
'
;
let
DB_NAME
=
"
DB00.db
"
;
let
TBL_NAME
=
"
TBL00
"
;
...
...
@@ -56,7 +77,7 @@ export default class DataShareExtAbility extends DataShareExtensionAbility {
onCreate
(
want
,
callback
)
{
rdb
.
getRdbStore
(
this
.
context
,
{
name
:
DB_NAME
},
1
,
function
(
err
,
data
)
{
},
function
(
err
,
data
)
{
console
.
log
(
'
getRdbStore done, data :
'
+
data
);
rdbStore
=
data
;
rdbStore
.
executeSql
(
DDL_TBL_CREATE
,
[],
function
(
err
)
{
...
...
@@ -89,7 +110,7 @@ Inserts data into the database. This API can be overridden as required.
**Example**
```
ts
import
rdb
from
'
@ohos.data.r
db
'
;
import
rdb
from
'
@ohos.data.r
elationalStore
'
;
let
DB_NAME
=
"
DB00.db
"
;
let
TBL_NAME
=
"
TBL00
"
;
...
...
@@ -134,7 +155,7 @@ Updates data in the database. This API can be overridden as required.
**Example**
```
ts
import
rdb
from
'
@ohos.data.r
db
'
;
import
rdb
from
'
@ohos.data.r
elationalStore
'
;
let
DB_NAME
=
"
DB00.db
"
;
let
TBL_NAME
=
"
TBL00
"
;
...
...
@@ -176,7 +197,7 @@ Deletes data from the database. This API can be overridden as required.
**Example**
```
ts
import
rdb
from
'
@ohos.data.r
db
'
;
import
rdb
from
'
@ohos.data.r
elationalStore
'
;
let
DB_NAME
=
"
DB00.db
"
;
let
TBL_NAME
=
"
TBL00
"
;
...
...
@@ -219,7 +240,7 @@ Queries data from the database. This API can be overridden as required.
**Example**
```
ts
import
rdb
from
'
@ohos.data.r
db
'
;
import
rdb
from
'
@ohos.data.r
elationalStore
'
;
let
DB_NAME
=
"
DB00.db
"
;
let
TBL_NAME
=
"
TBL00
"
;
...
...
@@ -264,7 +285,7 @@ Batch inserts data into the database. This API is called by the server and can b
**Example**
```
ts
import
rdb
from
'
@ohos.data.r
db
'
;
import
rdb
from
'
@ohos.data.r
elationalStore
'
;
let
DB_NAME
=
"
DB00.db
"
;
let
TBL_NAME
=
"
TBL00
"
;
...
...
en/application-dev/reference/apis/js-apis-data-DataShareResultSet.md
浏览文件 @
6c0b735b
#
Data Share Result
Set
#
@ohos.data.dataShareResult
Set
The
**DataShareResultSet**
module provides APIs for accessing the result set obtained from the database. You can access the values in the specified rows or the value of the specified data type.
...
...
en/application-dev/reference/apis/js-apis-data-dataShare.md
浏览文件 @
6c0b735b
此差异已折叠。
点击以展开。
en/application-dev/reference/apis/js-apis-data-rdb.md
浏览文件 @
6c0b735b
此差异已折叠。
点击以展开。
en/application-dev/reference/apis/js-apis-data-relationalStore.md
0 → 100644
浏览文件 @
6c0b735b
此差异已折叠。
点击以展开。
en/application-dev/reference/errorcodes/errorcode-datashare.md
0 → 100644
浏览文件 @
6c0b735b
# DataShare Error Codes
## 15700010 Failed to Create a DataShareHelper
**Error Message**
The dataShareHelper is not initialized successfully.
**Description**
The
**DataShareHelper**
class fails to be created.
**Possible Causes**
1.
The
**uri**
specified in
**createDataHelper**
is incorrect.
2.
The
**context**
specified in
**createDataHelper**
is incorrect.
**DataShare**
supports only the stage model.
**Solution**
1.
Obtain the correct URI.
2.
Check that the context of the stage model is used.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录