• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import featureAbility from '../@ohos.ability.featureAbility';
17import dataAbility from '../@ohos.data.dataAbility';
18import rdb from '../@ohos.data.rdb';
19
20/**
21 * Indicates an array of data operations that can contain several different operations on the database.
22 *
23 * @typedef DataAbilityOperation
24 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
25 * @since 7
26 */
27export interface DataAbilityOperation {
28  /**
29   * Indicates the path of data to operate.
30   *
31   * @type { string }
32   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
33   * @FAModelOnly
34   * @since 7
35   */
36  uri: string;
37
38  /**
39   * Indicates a operation type.
40   *
41   * @type { featureAbility.DataAbilityOperationType }
42   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
43   * @FAModelOnly
44   * @since 7
45   */
46  type: featureAbility.DataAbilityOperationType;
47
48  /**
49   * Indicates the data values to be set.
50   *
51   * @type { ?rdb.ValuesBucket }
52   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
53   * @FAModelOnly
54   * @since 7
55   */
56  valuesBucket?: rdb.ValuesBucket;
57
58  /**
59   * Indicates the valuesBucket object containing a set of key-value pairs.
60   *
61   * @type { ?rdb.ValuesBucket }
62   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
63   * @FAModelOnly
64   * @since 7
65   */
66  valueBackReferences?: rdb.ValuesBucket;
67
68  /**
69   * Indicates the filter criteria to set. If this parameter is null, all data records
70   * will be operated by default.
71   *
72   * @type { ?dataAbility.DataAbilityPredicates }
73   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
74   * @FAModelOnly
75   * @since 7
76   */
77  predicates?: dataAbility.DataAbilityPredicates;
78
79  /**
80   * Indicates the back reference to be used as a filter criterion in predicates.
81   *
82   * @type { ?Map<number, number> }
83   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
84   * @FAModelOnly
85   * @since 7
86   */
87  predicatesBackReferences?: Map<number, number>;
88
89  /**
90   * Specifies whether a batch operation can be interrupted.
91   *
92   * @type { ?boolean }
93   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
94   * @FAModelOnly
95   * @since 7
96   */
97  interrupted?: boolean;
98
99  /**
100   * Indicates the expected number of rows to update or delete.
101   *
102   * @type { ?number }
103   * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
104   * @FAModelOnly
105   * @since 7
106   */
107  expectedCount?: number;
108}
109