mirror of
https://github.com/openharmony/applications_calendar_data.git
synced 2026-07-01 20:14:02 -04:00
update entry/src/main/ets/DataAbility/DataShareExtAbility.ets.
添加批量插入接口 Signed-off-by: forever chicly <pengweiyin1@h-partners.com>
This commit is contained in:
@@ -59,6 +59,20 @@ export default class DataShareExtAbility extends Extension {
|
||||
}
|
||||
}
|
||||
|
||||
batchInsert(uri: string, value: relationalStore.ValuesBucket[], callback: Function) {
|
||||
if (isDatabaseInitComplete) {
|
||||
// If the database has been created, perform data operations directly
|
||||
this.doBachInsert(uri, value, callback);
|
||||
} else {
|
||||
// If the table is not created, try to create the database
|
||||
this.tryInitDatabase();
|
||||
// Recursively check whether the database is built, per 100ms
|
||||
setTimeout(() => {
|
||||
this.batchInsert(uri, value, callback);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: relationalStore.ValuesBucket, callback: Function) {
|
||||
if (isDatabaseInitComplete) {
|
||||
this.doUpdate(uri, predicates, value, callback);
|
||||
|
||||
Reference in New Issue
Block a user