Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
c7a8c61c
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看板
提交
c7a8c61c
编写于
9月 06, 2023
作者:
L
liusaimei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dataShare相关使用说明文档示例代码ArkTs规范整改
Signed-off-by:
N
liusaimei
<
liusaimei@huawei.com
>
上级
5d5029ac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
178 addition
and
199 deletion
+178
-199
zh-cn/application-dev/database/share-data-by-datashareextensionability.md
...n-dev/database/share-data-by-datashareextensionability.md
+120
-120
zh-cn/application-dev/reference/apis/js-apis-application-dataShareExtensionAbility.md
...nce/apis/js-apis-application-dataShareExtensionAbility.md
+58
-79
未找到文件。
zh-cn/application-dev/database/share-data-by-datashareextensionability.md
浏览文件 @
c7a8c61c
...
...
@@ -60,69 +60,69 @@
3.
在DataShareExtAbility.ts文件中,导入
`@ohos.application.DataShareExtensionAbility`
模块,开发者可根据应用需求选择性重写其业务实现。例如数据提供方只提供插入、删除和查询服务,则可只重写这些接口,并导入对应的基础依赖模块。
```
ts
import
Extension
from
'
@ohos.application.DataShareExtensionAbility
'
;
import
rdb
from
'
@ohos.data.relationalStore
'
;
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
import
relationalStore
from
'
@ohos.data.relationalStore
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
```
```
ts
import
Extension
from
'
@ohos.application.DataShareExtensionAbility
'
;
import
rdb
from
'
@ohos.data.relationalStore
'
;
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
import
relationalStore
from
'
@ohos.data.relationalStore
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
```
4.
数据提供方的业务实现由开发者自定义。例如可以通过数据库、读写文件或访问网络等各方式实现数据提供方的数据存储。
```
ts
const
DB_NAME
=
'
DB00.db
'
;
const
TBL_NAME
=
'
TBL00
'
;
const
DDL_TBL_CREATE
=
"
CREATE TABLE IF NOT EXISTS
"
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
let
result
:
string
;
export
default
class
DataShareExtAbility
extends
Extension
{
// 重写onCreate接口
onCreate
(
want
:
Want
,
callback
:
Function
)
{
result
=
this
.
context
.
cacheDir
+
'
/datashare.txt
'
;
// 业务实现使用RDB
rdb
.
getRdbStore
(
this
.
context
,
{
name
:
DB_NAME
,
securityLevel
:
rdb
.
SecurityLevel
.
S1
},
(
err
,
data
)
=>
{
rdbStore
=
data
;
rdbStore
.
executeSql
(
DDL_TBL_CREATE
,
[],
(
err
)
=>
{
console
.
info
(
`DataShareExtAbility onCreate, executeSql done err:
${
err
}
`
);
});
if
(
callback
)
{
callback
();
}
});
}
// 重写query接口
query
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
columns
:
Array
<
string
>
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
console
.
info
(
'
invalid predicates
'
);
}
try
{
rdbStore
.
query
(
TBL_NAME
,
predicates
,
columns
,
(
err
,
resultSet
)
=>
{
if
(
resultSet
!==
undefined
)
{
console
.
info
(
`resultSet.rowCount:
${
resultSet
.
rowCount
}
`
);
}
if
(
callback
!==
undefined
)
{
callback
(
err
,
resultSet
);
}
});
}
catch
(
err
)
{
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
console
.
error
(
`Failed to query. Code:
${
code
}
,message:
${
message
}
`
);
}
}
// 可根据应用需求,选择性重写各个接口
};
```
```
ts
const
DB_NAME
=
'
DB00.db
'
;
const
TBL_NAME
=
'
TBL00
'
;
const
DDL_TBL_CREATE
=
"
CREATE TABLE IF NOT EXISTS
"
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
let
result
:
string
;
export
default
class
DataShareExtAbility
extends
Extension
{
// 重写onCreate接口
onCreate
(
want
:
Want
,
callback
:
Function
)
{
result
=
this
.
context
.
cacheDir
+
'
/datashare.txt
'
;
// 业务实现使用RDB
rdb
.
getRdbStore
(
this
.
context
,
{
name
:
DB_NAME
,
securityLevel
:
rdb
.
SecurityLevel
.
S1
},
(
err
,
data
)
=>
{
rdbStore
=
data
;
rdbStore
.
executeSql
(
DDL_TBL_CREATE
,
[],
(
err
)
=>
{
console
.
info
(
`DataShareExtAbility onCreate, executeSql done err:
${
err
}
`
);
});
if
(
callback
)
{
callback
();
}
});
}
// 重写query接口
query
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
columns
:
Array
<
string
>
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
console
.
info
(
'
invalid predicates
'
);
}
try
{
rdbStore
.
query
(
TBL_NAME
,
predicates
,
columns
,
(
err
,
resultSet
)
=>
{
if
(
resultSet
!==
undefined
)
{
console
.
info
(
`resultSet.rowCount:
${
resultSet
.
rowCount
}
`
);
}
if
(
callback
!==
undefined
)
{
callback
(
err
,
resultSet
);
}
});
}
catch
(
err
)
{
let
code
=
(
err
as
BusinessError
).
code
;
let
message
=
(
err
as
BusinessError
).
message
console
.
error
(
`Failed to query. Code:
${
code
}
,message:
${
message
}
`
);
}
}
// 可根据应用需求,选择性重写各个接口
};
```
5.
在module.json5中定义DataShareExtensionAbility。
...
...
@@ -187,75 +187,75 @@ export default class DataShareExtAbility extends Extension {
1.
导入基础依赖包。
```
ts
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
dataShare
from
'
@ohos.data.dataShare
'
;
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
import
{
ValuesBucket
}
from
'
@ohos.data.ValuesBucket
'
import
window
from
'
@ohos.window
'
;
```
```
ts
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
dataShare
from
'
@ohos.data.dataShare
'
;
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
import
{
ValuesBucket
}
from
'
@ohos.data.ValuesBucket
'
import
window
from
'
@ohos.window
'
;
```
2.
定义与数据提供方通信的URI字符串。
```
ts
// 作为参数传递的URI,与module.json5中定义的URI的区别是多了一个"/",是因为作为参数传递的URI中,在第二个与第三个"/"中间,存在一个DeviceID的参数
let
dseUri
=
(
'
datashareproxy://com.samples.datasharetest.DataShare
'
);
```
```
ts
// 作为参数传递的URI,与module.json5中定义的URI的区别是多了一个"/",是因为作为参数传递的URI中,在第二个与第三个"/"中间,存在一个DeviceID的参数
let
dseUri
=
(
'
datashareproxy://com.samples.datasharetest.DataShare
'
);
```
3.
创建工具接口类对象。
```
ts
let
dsHelper
:
dataShare
.
DataShareHelper
|
undefined
=
undefined
;
let
abilityContext
:
Context
;
export
default
class
EntryAbility
extends
UIAbility
{
onWindowStageCreate
(
windowStage
:
window
.
WindowStage
)
{
abilityContext
=
this
.
context
;
dataShare
.
createDataShareHelper
(
abilityContext
,
dseUri
,
(
err
,
data
)
=>
{
dsHelper
=
data
;
});
}
}
```
```
ts
let
dsHelper
:
dataShare
.
DataShareHelper
|
undefined
=
undefined
;
let
abilityContext
:
Context
;
export
default
class
EntryAbility
extends
UIAbility
{
onWindowStageCreate
(
windowStage
:
window
.
WindowStage
)
{
abilityContext
=
this
.
context
;
dataShare
.
createDataShareHelper
(
abilityContext
,
dseUri
,
(
err
,
data
)
=>
{
dsHelper
=
data
;
});
}
}
```
4.
获取到接口类对象后,便可利用其提供的接口访问提供方提供的服务,如进行数据的增删改查等。
```
ts
// 构建一条数据
let
key1
=
'
name
'
;
let
key2
=
'
age
'
;
let
key3
=
'
isStudent
'
;
let
key4
=
'
Binary
'
;
let
valueName1
=
'
ZhangSan
'
;
let
valueName2
=
'
LiSi
'
;
let
valueAge1
=
21
;
let
valueAge2
=
18
;
let
valueIsStudent1
=
false
;
let
valueIsStudent2
=
true
;
let
valueBinary
=
new
Uint8Array
([
1
,
2
,
3
]);
let
valuesBucket
:
ValuesBucket
=
{
key1
:
valueName1
,
key2
:
valueAge1
,
key3
:
valueIsStudent1
,
key4
:
valueBinary
};
let
updateBucket
:
ValuesBucket
=
{
key1
:
valueName2
,
key2
:
valueAge2
,
key3
:
valueIsStudent2
,
key4
:
valueBinary
};
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
let
valArray
=
[
'
*
'
];
if
(
dsHelper
!=
undefined
)
{
// 插入一条数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
insert
(
dseUri
,
valuesBucket
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper insert result:
${
data
}
`
);
});
// 更新数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
update
(
dseUri
,
predicates
,
updateBucket
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper update result:
${
data
}
`
);
});
// 查询数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
query
(
dseUri
,
predicates
,
valArray
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper query result:
${
data
}
`
);
});
// 删除指定的数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
delete
(
dseUri
,
predicates
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper delete result:
${
data
}
`
);
});
}
```
```
ts
// 构建一条数据
let
key1
=
'
name
'
;
let
key2
=
'
age
'
;
let
key3
=
'
isStudent
'
;
let
key4
=
'
Binary
'
;
let
valueName1
=
'
ZhangSan
'
;
let
valueName2
=
'
LiSi
'
;
let
valueAge1
=
21
;
let
valueAge2
=
18
;
let
valueIsStudent1
=
false
;
let
valueIsStudent2
=
true
;
let
valueBinary
=
new
Uint8Array
([
1
,
2
,
3
]);
let
valuesBucket
:
ValuesBucket
=
{
key1
:
valueName1
,
key2
:
valueAge1
,
key3
:
valueIsStudent1
,
key4
:
valueBinary
};
let
updateBucket
:
ValuesBucket
=
{
key1
:
valueName2
,
key2
:
valueAge2
,
key3
:
valueIsStudent2
,
key4
:
valueBinary
};
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
let
valArray
=
[
'
*
'
];
if
(
dsHelper
!=
undefined
)
{
// 插入一条数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
insert
(
dseUri
,
valuesBucket
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper insert result:
${
data
}
`
);
});
// 更新数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
update
(
dseUri
,
predicates
,
updateBucket
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper update result:
${
data
}
`
);
});
// 查询数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
query
(
dseUri
,
predicates
,
valArray
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper query result:
${
data
}
`
);
});
// 删除指定的数据
(
dsHelper
as
dataShare
.
DataShareHelper
).
delete
(
dseUri
,
predicates
,
(
err
,
data
)
=>
{
console
.
info
(
`dsHelper delete result:
${
data
}
`
);
});
}
```
## 相关实例
...
...
zh-cn/application-dev/reference/apis/js-apis-application-dataShareExtensionAbility.md
浏览文件 @
c7a8c61c
...
...
@@ -43,33 +43,32 @@ DataShare客户端连接DataShareExtensionAbility服务端时,服务端回调
**示例:**
```
ts
import
rdb
from
'
@ohos.data.relationalStore
'
import
relationalStore
from
'
@ohos.data.relationalStore
'
import
Want
from
'
@ohos.app.ability.Want
'
let
DB_NAME
=
'
DB00.db
'
;
let
TBL_NAME
=
'
TBL00
'
;
let
DDL_TBL_CREATE
=
'
CREATE TABLE IF NOT EXISTS
'
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)
'
;
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
onCreate
(
want
:
Want
,
callback
:
Function
)
{
rdb
.
getRdbStore
(
this
.
context
,
{
name
:
DB_NAME
,
securityLevel
:
rdb
.
SecurityLevel
.
S1
},
(
err
,
data
)
=>
{
console
.
info
(
`getRdbStore done, data :
${
data
}
`
);
rdbStore
=
data
;
rdbStore
.
executeSql
(
DDL_TBL_CREATE
,
[],
(
err
)
=>
{
console
.
error
(
`executeSql done, error message :
${
err
}
`
);
});
if
(
callback
)
{
callback
();
}
});
}
onCreate
(
want
:
Want
,
callback
:
Function
)
{
relationalStore
.
getRdbStore
(
globalThis
.
getContext
()
,
{
name
:
DB_NAME
,
securityLevel
:
relationalStore
.
SecurityLevel
.
S1
},
(
err
,
data
)
=>
{
console
.
info
(
`getRdbStore done, data :
${
data
}
`
);
rdbStore
=
data
;
rdbStore
.
executeSql
(
DDL_TBL_CREATE
,
[],
(
err
)
=>
{
console
.
error
(
`executeSql done, error message :
${
err
}
`
);
});
if
(
callback
)
{
callback
();
}
});
}
};
```
...
...
@@ -95,26 +94,22 @@ insert?(uri: string, valueBucket: ValuesBucket, callback: AsyncCallback<numbe
import
relationalStore
from
'
@ohos.data.relationalStore
'
import
{
ValuesBucket
}
from
'
@ohos.data.ValuesBucket
'
let
DB_NAME
=
'
DB00.db
'
;
let
TBL_NAME
=
'
TBL00
'
;
let
DDL_TBL_CREATE
=
'
CREATE TABLE IF NOT EXISTS
'
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
insert
(
uri
:
string
,
valueBucket
:
ValuesBucket
,
callback
:
Function
)
{
if
(
valueBucket
===
null
)
{
console
.
error
(
'
invalid valueBuckets
'
);
return
;
}
rdbStore
.
insert
(
TBL_NAME
,
valueBucket
,
(
err
,
ret
)
=>
{
console
.
info
(
`callback ret:
${
ret
}
`
);
if
(
callback
!==
undefined
)
{
callback
(
err
,
ret
);
}
});
insert
(
uri
:
string
,
valueBucket
:
ValuesBucket
,
callback
:
Function
)
{
if
(
valueBucket
===
null
)
{
console
.
error
(
'
invalid valueBuckets
'
);
return
;
}
rdbStore
.
insert
(
TBL_NAME
,
valueBucket
,
(
err
,
ret
)
=>
{
console
.
info
(
`callback ret:
${
ret
}
`
);
if
(
callback
!==
undefined
)
{
callback
(
err
,
ret
);
}
});
}
};
```
...
...
@@ -142,24 +137,20 @@ import relationalStore from '@ohos.data.relationalStore';
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
import
{
ValuesBucket
}
from
'
@ohos.data.ValuesBucket
'
let
DB_NAME
=
'
DB00.db
'
;
let
TBL_NAME
=
'
TBL00
'
;
let
DDL_TBL_CREATE
=
'
CREATE TABLE IF NOT EXISTS
'
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
update
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
valueBucket
:
ValuesBucket
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
return
;
}
rdbStore
.
update
(
TBL_NAME
,
valueBucket
,
predicates
,
(
err
,
ret
)
=>
{
if
(
callback
!==
undefined
)
{
callback
(
err
,
ret
);
}
});
update
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
valueBucket
:
ValuesBucket
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
return
;
}
rdbStore
.
update
(
TBL_NAME
,
valueBucket
,
predicates
,
(
err
,
ret
)
=>
{
if
(
callback
!==
undefined
)
{
callback
(
err
,
ret
);
}
});
}
};
```
...
...
@@ -185,24 +176,20 @@ delete?(uri: string, predicates: dataSharePredicates.DataSharePredicates, callba
import
relationalStore
from
'
@ohos.data.relationalStore
'
;
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
let
DB_NAME
=
'
DB00.db
'
;
let
TBL_NAME
=
'
TBL00
'
;
let
DDL_TBL_CREATE
=
'
CREATE TABLE IF NOT EXISTS
'
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
delete
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
return
;
}
rdbStore
.
delete
(
TBL_NAME
,
predicates
,
(
err
,
ret
)
=>
{
if
(
callback
!==
undefined
)
{
callback
(
err
,
ret
);
}
});
delete
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
return
;
}
rdbStore
.
delete
(
TBL_NAME
,
predicates
,
(
err
,
ret
)
=>
{
if
(
callback
!==
undefined
)
{
callback
(
err
,
ret
);
}
});
}
};
```
...
...
@@ -229,27 +216,23 @@ query?(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns
import
relationalStore
from
'
@ohos.data.relationalStore
'
;
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
let
DB_NAME
=
'
DB00.db
'
;
let
TBL_NAME
=
'
TBL00
'
;
let
DDL_TBL_CREATE
=
'
CREATE TABLE IF NOT EXISTS
'
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
query
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
columns
:
Array
<
string
>
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
return
;
}
rdbStore
.
query
(
TBL_NAME
,
predicates
,
columns
,
(
err
,
resultSet
)
=>
{
if
(
resultSet
!==
undefined
)
{
console
.
info
(
`resultSet.rowCount:
${
resultSet
.
rowCount
}
`
);
}
if
(
callback
!==
undefined
)
{
callback
(
err
,
resultSet
);
}
});
query
(
uri
:
string
,
predicates
:
dataSharePredicates
.
DataSharePredicates
,
columns
:
Array
<
string
>
,
callback
:
Function
)
{
if
(
predicates
===
null
||
predicates
===
undefined
)
{
return
;
}
rdbStore
.
query
(
TBL_NAME
,
predicates
,
columns
,
(
err
,
resultSet
)
=>
{
if
(
resultSet
!==
undefined
)
{
console
.
info
(
`resultSet.rowCount:
${
resultSet
.
rowCount
}
`
);
}
if
(
callback
!==
undefined
)
{
callback
(
err
,
resultSet
);
}
});
}
};
```
...
...
@@ -275,11 +258,7 @@ batchInsert?(uri: string, valueBuckets: Array<ValuesBucket>, callback: Asy
import
relationalStore
from
'
@ohos.data.relationalStore
'
;
import
{
ValuesBucket
}
from
'
@ohos.data.ValuesBucket
'
let
DB_NAME
=
'
DB00.db
'
;
let
TBL_NAME
=
'
TBL00
'
;
let
DDL_TBL_CREATE
=
'
CREATE TABLE IF NOT EXISTS
'
+
TBL_NAME
+
'
(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, phoneNumber DOUBLE, isStudent BOOLEAN, Binary BINARY)
'
;
let
rdbStore
:
relationalStore
.
RdbStore
;
export
default
class
DataShareExtAbility
extends
DataShareExtensionAbility
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录