161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit ArkData
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base';
2261847f8eSopenharmony_ciimport rdb from './@ohos.data.rdb';
2361847f8eSopenharmony_ci
2461847f8eSopenharmony_ci/**
2561847f8eSopenharmony_ci * Provides predicates for implementing diverse query methods.
2661847f8eSopenharmony_ci *
2761847f8eSopenharmony_ci * @namespace dataAbility
2861847f8eSopenharmony_ci * @syscap SystemCapability.DistributedDataManager.DataShare.Core
2961847f8eSopenharmony_ci * @since 7
3061847f8eSopenharmony_ci */
3161847f8eSopenharmony_cideclare namespace dataAbility {
3261847f8eSopenharmony_ci  /**
3361847f8eSopenharmony_ci   * Create an RdbPredicates by table name and DataAbilityPredicates.
3461847f8eSopenharmony_ci   * This method is similar to = of the SQL statement.
3561847f8eSopenharmony_ci   *
3661847f8eSopenharmony_ci   * @param { string } name - Indicates the table name.
3761847f8eSopenharmony_ci   * @param { DataAbilityPredicates } dataAbilityPredicates - Indicates the dataAbility predicates.
3861847f8eSopenharmony_ci   * @returns { rdb.RdbPredicates } Returns an RdbPredicates.
3961847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.DataShare.Core
4061847f8eSopenharmony_ci   * @since 7
4161847f8eSopenharmony_ci   */
4261847f8eSopenharmony_ci  function createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates;
4361847f8eSopenharmony_ci
4461847f8eSopenharmony_ci  /**
4561847f8eSopenharmony_ci   * Manages relational database configurations.
4661847f8eSopenharmony_ci   *
4761847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.DataShare.Core
4861847f8eSopenharmony_ci   * @since 7
4961847f8eSopenharmony_ci   */
5061847f8eSopenharmony_ci  class DataAbilityPredicates {
5161847f8eSopenharmony_ci    /**
5261847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the field whose data type is ValueType and value is equal
5361847f8eSopenharmony_ci     * to a specified value.
5461847f8eSopenharmony_ci     * This method is similar to = of the SQL statement.
5561847f8eSopenharmony_ci     *
5661847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
5761847f8eSopenharmony_ci     * @param { ValueType } value - Indicates the value to match with the DataAbilityPredicates.
5861847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
5961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
6061847f8eSopenharmony_ci     * @since 7
6161847f8eSopenharmony_ci     */
6261847f8eSopenharmony_ci    equalTo(field: string, value: ValueType): DataAbilityPredicates;
6361847f8eSopenharmony_ci
6461847f8eSopenharmony_ci    /**
6561847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the field whose data type is ValueType and value is unequal to
6661847f8eSopenharmony_ci     * a specified value.
6761847f8eSopenharmony_ci     * Configure the data capability predicate to match a field where the data type is a value type and the value is
6861847f8eSopenharmony_ci     * not equal to the specified value.
6961847f8eSopenharmony_ci     * This method is similar to != of the SQL statement.
7061847f8eSopenharmony_ci     *
7161847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
7261847f8eSopenharmony_ci     * @param { ValueType } value - Indicates the value to match with the DataAbilityPredicates.
7361847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
7461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
7561847f8eSopenharmony_ci     * @since 7
7661847f8eSopenharmony_ci     */
7761847f8eSopenharmony_ci    notEqualTo(field: string, value: ValueType): DataAbilityPredicates;
7861847f8eSopenharmony_ci
7961847f8eSopenharmony_ci    /**
8061847f8eSopenharmony_ci     * Adds a left parenthesis to the DataAbilityPredicates.
8161847f8eSopenharmony_ci     * This method is similar to ( of the SQL statement and needs to be used together with endWrap().
8261847f8eSopenharmony_ci     *
8361847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the left parenthesis.
8461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
8561847f8eSopenharmony_ci     * @since 7
8661847f8eSopenharmony_ci     */
8761847f8eSopenharmony_ci    beginWrap(): DataAbilityPredicates;
8861847f8eSopenharmony_ci
8961847f8eSopenharmony_ci    /**
9061847f8eSopenharmony_ci     * Adds a right parenthesis to the DataAbilityPredicates.
9161847f8eSopenharmony_ci     * This method is similar to ) of the SQL statement and needs to be used together
9261847f8eSopenharmony_ci     * with beginWrap().
9361847f8eSopenharmony_ci     *
9461847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the right parenthesis.
9561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
9661847f8eSopenharmony_ci     * @since 7
9761847f8eSopenharmony_ci     */
9861847f8eSopenharmony_ci    endWrap(): DataAbilityPredicates;
9961847f8eSopenharmony_ci
10061847f8eSopenharmony_ci    /**
10161847f8eSopenharmony_ci     * Adds an or condition to the DataAbilityPredicates.
10261847f8eSopenharmony_ci     * This method is similar to or of the SQL statement.
10361847f8eSopenharmony_ci     *
10461847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the or condition.
10561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
10661847f8eSopenharmony_ci     * @since 7
10761847f8eSopenharmony_ci     */
10861847f8eSopenharmony_ci    or(): DataAbilityPredicates;
10961847f8eSopenharmony_ci
11061847f8eSopenharmony_ci    /**
11161847f8eSopenharmony_ci     * Adds an and condition to the DataAbilityPredicates.
11261847f8eSopenharmony_ci     * This method is similar to and of the SQL statement.
11361847f8eSopenharmony_ci     *
11461847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the and condition.
11561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
11661847f8eSopenharmony_ci     * @since 7
11761847f8eSopenharmony_ci     */
11861847f8eSopenharmony_ci    and(): DataAbilityPredicates;
11961847f8eSopenharmony_ci
12061847f8eSopenharmony_ci    /**
12161847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the field whose data type is string and value
12261847f8eSopenharmony_ci     * contains a specified value.
12361847f8eSopenharmony_ci     * This method is similar to contains of the SQL statement.
12461847f8eSopenharmony_ci     *
12561847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
12661847f8eSopenharmony_ci     * @param { string } value - Indicates the value to match with the DataAbilityPredicates.
12761847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
12861847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
12961847f8eSopenharmony_ci     * @since 7
13061847f8eSopenharmony_ci     */
13161847f8eSopenharmony_ci    contains(field: string, value: string): DataAbilityPredicates;
13261847f8eSopenharmony_ci
13361847f8eSopenharmony_ci    /**
13461847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the field whose data type is string and value starts
13561847f8eSopenharmony_ci     * with a specified string.
13661847f8eSopenharmony_ci     * This method is similar to value% of the SQL statement.
13761847f8eSopenharmony_ci     *
13861847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
13961847f8eSopenharmony_ci     * @param { string } value - Indicates the value to match with the DataAbilityPredicates.
14061847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
14161847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
14261847f8eSopenharmony_ci     * @since 7
14361847f8eSopenharmony_ci     */
14461847f8eSopenharmony_ci    beginsWith(field: string, value: string): DataAbilityPredicates;
14561847f8eSopenharmony_ci
14661847f8eSopenharmony_ci    /**
14761847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the field whose data type is string and value
14861847f8eSopenharmony_ci     * ends with a specified string.
14961847f8eSopenharmony_ci     * This method is similar to %value of the SQL statement.
15061847f8eSopenharmony_ci     *
15161847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
15261847f8eSopenharmony_ci     * @param { string } value - Indicates the value to match with the DataAbilityPredicates.
15361847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
15461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
15561847f8eSopenharmony_ci     * @since 7
15661847f8eSopenharmony_ci     */
15761847f8eSopenharmony_ci    endsWith(field: string, value: string): DataAbilityPredicates;
15861847f8eSopenharmony_ci
15961847f8eSopenharmony_ci    /**
16061847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the fields whose value is null.
16161847f8eSopenharmony_ci     * This method is similar to is null of the SQL statement.
16261847f8eSopenharmony_ci     *
16361847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
16461847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
16561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
16661847f8eSopenharmony_ci     * @since 7
16761847f8eSopenharmony_ci     */
16861847f8eSopenharmony_ci    isNull(field: string): DataAbilityPredicates;
16961847f8eSopenharmony_ci
17061847f8eSopenharmony_ci    /**
17161847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the specified fields whose value is not null.
17261847f8eSopenharmony_ci     * This method is similar to is not null of the SQL statement.
17361847f8eSopenharmony_ci     *
17461847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
17561847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
17661847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
17761847f8eSopenharmony_ci     * @since 7
17861847f8eSopenharmony_ci     */
17961847f8eSopenharmony_ci    isNotNull(field: string): DataAbilityPredicates;
18061847f8eSopenharmony_ci
18161847f8eSopenharmony_ci    /**
18261847f8eSopenharmony_ci     * Configure the DataAbilityPredicates to match the fields whose data type is string and value is
18361847f8eSopenharmony_ci     * similar to a specified string.
18461847f8eSopenharmony_ci     * This method is similar to like of the SQL statement.
18561847f8eSopenharmony_ci     *
18661847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
18761847f8eSopenharmony_ci     * @param { string } value - Indicates the value to match with the DataAbilityPredicates. The percent sign (%)
18861847f8eSopenharmony_ci     *                           in the value is a wildcard (like * in a regular expression).
18961847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
19061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
19161847f8eSopenharmony_ci     * @since 7
19261847f8eSopenharmony_ci     */
19361847f8eSopenharmony_ci    like(field: string, value: string): DataAbilityPredicates;
19461847f8eSopenharmony_ci
19561847f8eSopenharmony_ci    /**
19661847f8eSopenharmony_ci     * Configure DataAbilityPredicates to match the specified field whose data type is string and the value contains
19761847f8eSopenharmony_ci     * a wildcard.Different from like, the input parameters of this method are case-sensitive.
19861847f8eSopenharmony_ci     *
19961847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
20061847f8eSopenharmony_ci     * @param { string } value - Indicates the value to match with DataAbilityPredicates.
20161847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL statement with the specified DataAbilityPredicates.
20261847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
20361847f8eSopenharmony_ci     * @since 7
20461847f8eSopenharmony_ci     */
20561847f8eSopenharmony_ci    glob(field: string, value: string): DataAbilityPredicates;
20661847f8eSopenharmony_ci
20761847f8eSopenharmony_ci    /**
20861847f8eSopenharmony_ci     * Restricts the value of the field to the range between low value and high value.
20961847f8eSopenharmony_ci     *
21061847f8eSopenharmony_ci     * @param { string } field - Indicates the column name.
21161847f8eSopenharmony_ci     * @param { ValueType } low - Indicates the minimum value.
21261847f8eSopenharmony_ci     * @param { ValueType } high - Indicates the maximum value.
21361847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
21461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
21561847f8eSopenharmony_ci     * @since 7
21661847f8eSopenharmony_ci     */
21761847f8eSopenharmony_ci    between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates;
21861847f8eSopenharmony_ci
21961847f8eSopenharmony_ci    /**
22061847f8eSopenharmony_ci     * Configure DataAbilityPredicates to match the specified field whose data type is int and value is
22161847f8eSopenharmony_ci     * out of a given range.
22261847f8eSopenharmony_ci     *
22361847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
22461847f8eSopenharmony_ci     * @param { ValueType } low - Indicates the minimum value to match with DataAbilityPredicates}.
22561847f8eSopenharmony_ci     * @param { ValueType } high - Indicates the maximum value to match with DataAbilityPredicates}.
22661847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
22761847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
22861847f8eSopenharmony_ci     * @since 7
22961847f8eSopenharmony_ci     */
23061847f8eSopenharmony_ci    notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates;
23161847f8eSopenharmony_ci
23261847f8eSopenharmony_ci    /**
23361847f8eSopenharmony_ci     * Restricts the value of the field to be greater than the specified value.
23461847f8eSopenharmony_ci     *
23561847f8eSopenharmony_ci     * @param { string } field - Indicates the column name.
23661847f8eSopenharmony_ci     * @param { ValueType } value - Indicates the String field.
23761847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
23861847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
23961847f8eSopenharmony_ci     * @since 7
24061847f8eSopenharmony_ci     */
24161847f8eSopenharmony_ci    greaterThan(field: string, value: ValueType): DataAbilityPredicates;
24261847f8eSopenharmony_ci
24361847f8eSopenharmony_ci    /**
24461847f8eSopenharmony_ci     * Restricts the value of the field to be smaller than the specified value.
24561847f8eSopenharmony_ci     *
24661847f8eSopenharmony_ci     * @param { string } field - Indicates the column name.
24761847f8eSopenharmony_ci     * @param { ValueType } value - Indicates the String field.
24861847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
24961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
25061847f8eSopenharmony_ci     * @since 7
25161847f8eSopenharmony_ci     */
25261847f8eSopenharmony_ci    lessThan(field: string, value: ValueType): DataAbilityPredicates;
25361847f8eSopenharmony_ci
25461847f8eSopenharmony_ci    /**
25561847f8eSopenharmony_ci     * Restricts the value of the field to be greater than or equal to the specified value.
25661847f8eSopenharmony_ci     *
25761847f8eSopenharmony_ci     * @param { string } field - Indicates the column name.
25861847f8eSopenharmony_ci     * @param { ValueType } value - Indicates the String field.
25961847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
26061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
26161847f8eSopenharmony_ci     * @since 7
26261847f8eSopenharmony_ci     */
26361847f8eSopenharmony_ci    greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates;
26461847f8eSopenharmony_ci
26561847f8eSopenharmony_ci    /**
26661847f8eSopenharmony_ci     * Restricts the value of the field to be smaller than or equal to the specified value.
26761847f8eSopenharmony_ci     *
26861847f8eSopenharmony_ci     * @param { string } field - Indicates the column name.
26961847f8eSopenharmony_ci     * @param { ValueType } value - Indicates the String field.
27061847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
27161847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
27261847f8eSopenharmony_ci     * @since 7
27361847f8eSopenharmony_ci     */
27461847f8eSopenharmony_ci    lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates;
27561847f8eSopenharmony_ci
27661847f8eSopenharmony_ci    /**
27761847f8eSopenharmony_ci     * Restricts the ascending order of the return list. When there are several orders,
27861847f8eSopenharmony_ci     * the one close to the head has the highest priority.
27961847f8eSopenharmony_ci     *
28061847f8eSopenharmony_ci     * @param { string } field - Indicates the column name for sorting the return list.
28161847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
28261847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
28361847f8eSopenharmony_ci     * @since 7
28461847f8eSopenharmony_ci     */
28561847f8eSopenharmony_ci    orderByAsc(field: string): DataAbilityPredicates;
28661847f8eSopenharmony_ci
28761847f8eSopenharmony_ci    /**
28861847f8eSopenharmony_ci     * Restricts the descending order of the return list. When there are several orders,
28961847f8eSopenharmony_ci     * the one close to the head has the highest priority.
29061847f8eSopenharmony_ci     *
29161847f8eSopenharmony_ci     * @param { string } field - Indicates the column name for sorting the return list.
29261847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
29361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
29461847f8eSopenharmony_ci     * @since 7
29561847f8eSopenharmony_ci     */
29661847f8eSopenharmony_ci    orderByDesc(field: string): DataAbilityPredicates;
29761847f8eSopenharmony_ci
29861847f8eSopenharmony_ci    /**
29961847f8eSopenharmony_ci     * Restricts each row of the query result to be unique.
30061847f8eSopenharmony_ci     *
30161847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
30261847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
30361847f8eSopenharmony_ci     * @since 7
30461847f8eSopenharmony_ci     */
30561847f8eSopenharmony_ci    distinct(): DataAbilityPredicates;
30661847f8eSopenharmony_ci
30761847f8eSopenharmony_ci    /**
30861847f8eSopenharmony_ci     * Restricts the max number of return records.
30961847f8eSopenharmony_ci     *
31061847f8eSopenharmony_ci     * @param { number } value - Indicates the max length of the return list.
31161847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
31261847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
31361847f8eSopenharmony_ci     * @since 7
31461847f8eSopenharmony_ci     */
31561847f8eSopenharmony_ci    limitAs(value: number): DataAbilityPredicates;
31661847f8eSopenharmony_ci
31761847f8eSopenharmony_ci    /**
31861847f8eSopenharmony_ci     * Configure DataAbilityPredicates to specify the start position of the returned result.
31961847f8eSopenharmony_ci     * Use this method together with limit(int).
32061847f8eSopenharmony_ci     *
32161847f8eSopenharmony_ci     * @param { number } rowOffset - Indicates the start position of the returned result. The value is a positive integer.
32261847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified AbsPredicates.
32361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
32461847f8eSopenharmony_ci     * @since 7
32561847f8eSopenharmony_ci     */
32661847f8eSopenharmony_ci    offsetAs(rowOffset: number): DataAbilityPredicates;
32761847f8eSopenharmony_ci
32861847f8eSopenharmony_ci    /**
32961847f8eSopenharmony_ci     * Configure DataAbilityPredicates to group query results by specified columns.
33061847f8eSopenharmony_ci     *
33161847f8eSopenharmony_ci     * @param { Array<string> } fields - Indicates the specified columns by which query results are grouped.
33261847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the specified columns by which query
33361847f8eSopenharmony_ci     *                                    results are grouped.
33461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
33561847f8eSopenharmony_ci     * @since 7
33661847f8eSopenharmony_ci     */
33761847f8eSopenharmony_ci    groupBy(fields: Array<string>): DataAbilityPredicates;
33861847f8eSopenharmony_ci
33961847f8eSopenharmony_ci    /**
34061847f8eSopenharmony_ci     * Configure DataAbilityPredicates to specify the index column.
34161847f8eSopenharmony_ci     * Before using this method, you need to create an index column.
34261847f8eSopenharmony_ci     *
34361847f8eSopenharmony_ci     * @param { string } field - Indicates the name of the index column.
34461847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns DataAbilityPredicates with the specified index column.
34561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
34661847f8eSopenharmony_ci     * @since 7
34761847f8eSopenharmony_ci     */
34861847f8eSopenharmony_ci    indexedBy(field: string): DataAbilityPredicates;
34961847f8eSopenharmony_ci
35061847f8eSopenharmony_ci    /**
35161847f8eSopenharmony_ci     * Configure DataAbilityPredicates to match the specified field whose data type is ValueType array and values
35261847f8eSopenharmony_ci     * are within a given range.
35361847f8eSopenharmony_ci     *
35461847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
35561847f8eSopenharmony_ci     * @param { Array<ValueType> } value - Indicates the values to match with DataAbilityPredicates.
35661847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns DataAbilityPredicates that matches the specified field.
35761847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
35861847f8eSopenharmony_ci     * @since 7
35961847f8eSopenharmony_ci     */
36061847f8eSopenharmony_ci    in(field: string, value: Array<ValueType>): DataAbilityPredicates;
36161847f8eSopenharmony_ci
36261847f8eSopenharmony_ci    /**
36361847f8eSopenharmony_ci     * Configure {@code DataAbilityPredicates} to match the specified field whose data type is String array and values
36461847f8eSopenharmony_ci     * are out of a given range.
36561847f8eSopenharmony_ci     *
36661847f8eSopenharmony_ci     * @param { string } field - Indicates the column name in the database table.
36761847f8eSopenharmony_ci     * @param { Array<ValueType> } value - Indicates the values to match with DataAbilityPredicates.
36861847f8eSopenharmony_ci     * @returns { DataAbilityPredicates } Returns DataAbilityPredicates that matches the specified field.
36961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.DataShare.Core
37061847f8eSopenharmony_ci     * @since 7
37161847f8eSopenharmony_ci     */
37261847f8eSopenharmony_ci    notIn(field: string, value: Array<ValueType>): DataAbilityPredicates;
37361847f8eSopenharmony_ci  }
37461847f8eSopenharmony_ci  /**
37561847f8eSopenharmony_ci   * Indicates possible value types
37661847f8eSopenharmony_ci   *
37761847f8eSopenharmony_ci   * @typedef { number | string | boolean }
37861847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.DataShare.Core
37961847f8eSopenharmony_ci   * @since 7
38061847f8eSopenharmony_ci   */
38161847f8eSopenharmony_ci  type ValueType = number | string | boolean;
38261847f8eSopenharmony_ci}
38361847f8eSopenharmony_ci
38461847f8eSopenharmony_ciexport default dataAbility;
385