2022-05-07 03:17:39 +00:00
|
|
|
/*
|
2023-05-25 13:49:47 +00:00
|
|
|
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
2022-05-07 03:17:39 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @kit ArkData
|
|
|
|
*/
|
|
|
|
|
2022-05-11 11:14:07 +00:00
|
|
|
import { ValueType } from './@ohos.data.ValuesBucket';
|
2022-05-07 08:01:31 +00:00
|
|
|
|
2022-05-07 03:17:39 +00:00
|
|
|
/**
|
2023-01-12 07:35:55 +00:00
|
|
|
* This module provides data share services based on the ExtensionAbility.
|
|
|
|
*
|
|
|
|
* @namespace dataSharePredicates
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
2023-01-11 07:33:57 +00:00
|
|
|
declare namespace dataSharePredicates {
|
2023-03-25 08:06:25 +00:00
|
|
|
/**
|
|
|
|
* Manages relational database configurations.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2023-03-25 08:06:25 +00:00
|
|
|
*/
|
|
|
|
class DataSharePredicates {
|
2022-05-07 03:17:39 +00:00
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the field whose data type is ValueType and value is equal
|
2022-05-07 03:17:39 +00:00
|
|
|
* to a specified value.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to = of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { ValueType } value - Indicates the value to match with the DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
equalTo(field: string, value: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the field whose data type is ValueType and value is unequal to
|
2022-05-07 03:17:39 +00:00
|
|
|
* a specified value.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to != of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { ValueType } value - Indicates the value to match with the DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
notEqualTo(field: string, value: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a left parenthesis to the DataSharePredicates.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to ( of the SQL statement and needs to be used together with endWrap().
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates with the left parenthesis.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
beginWrap(): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a right parenthesis to the DataSharePredicates.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to ) of the SQL statement and needs to be used together
|
2022-05-07 03:17:39 +00:00
|
|
|
* with beginWrap().
|
2023-03-25 08:06:25 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates with the right parenthesis.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
endWrap(): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds an or condition to the DataSharePredicates.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to or of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates with the or condition.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
or(): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds an and condition to the DataSharePredicates.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to and of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates with the and condition.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
and(): DataSharePredicates;
|
2023-01-11 07:33:57 +00:00
|
|
|
|
2022-05-07 03:17:39 +00:00
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the field whose data type is string and value
|
2022-05-07 03:17:39 +00:00
|
|
|
* contains a specified value.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to contains of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { string } value - Indicates the value to match with the DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
contains(field: string, value: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the field whose data type is string and value starts
|
2022-05-07 03:17:39 +00:00
|
|
|
* with a specified string.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to value% of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { string } value - Indicates the value to match with the DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
beginsWith(field: string, value: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the field whose data type is string and value
|
2022-05-07 03:17:39 +00:00
|
|
|
* ends with a specified string.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to %value of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { string } value - Indicates the value to match with the DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
endsWith(field: string, value: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the fields whose value is null.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to is null of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
isNull(field: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the specified fields whose value is not null.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to is not null of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
isNotNull(field: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the fields whose data type is string and value is
|
2022-05-07 03:17:39 +00:00
|
|
|
* similar to a specified string.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to like of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { string } value - Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value
|
2022-05-07 03:17:39 +00:00
|
|
|
* is a wildcard (like * in a regular expression).
|
2023-04-07 06:32:17 +00:00
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
like(field: string, value: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure the DataSharePredicates to match the fields whose data type is string and value is
|
2023-12-21 06:20:24 +00:00
|
|
|
* not similar to a specified string.
|
2022-11-17 08:49:05 +00:00
|
|
|
* This method is similar to unlike of the SQL statement.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { string } value - Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value
|
2022-05-07 03:17:39 +00:00
|
|
|
* is a wildcard (like * in a regular expression).
|
2023-04-07 06:32:17 +00:00
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
2023-03-25 08:06:25 +00:00
|
|
|
unlike(field: string, value: string): DataSharePredicates;
|
2022-05-07 03:17:39 +00:00
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure DataSharePredicates to match the specified field whose data type is string and the value contains
|
2022-05-07 03:17:39 +00:00
|
|
|
* a wildcard.
|
2022-11-17 08:49:05 +00:00
|
|
|
* Different from like, the input parameters of this method are case-sensitive.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { string } value - Indicates the value to match with DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL statement with the specified DataSharePredicates.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
glob(field: string, value: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the value of the field to the range between low value and high value.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name.
|
|
|
|
* @param { ValueType } low - Indicates the minimum value.
|
|
|
|
* @param { ValueType } high - Indicates the maximum value.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
between(field: string, low: ValueType, high: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure DataSharePredicates to match the specified field whose data type is int and value is
|
2022-05-07 03:17:39 +00:00
|
|
|
* out of a given range.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { ValueType } low - Indicates the minimum value to match with DataSharePredicates.
|
|
|
|
* @param { ValueType } high - Indicates the maximum value to match with DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the value of the field to be greater than the specified value.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name.
|
|
|
|
* @param { ValueType } value - Indicates the String field.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
greaterThan(field: string, value: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the value of the field to be smaller than the specified value.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name.
|
|
|
|
* @param { ValueType } value - Indicates the String field.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
lessThan(field: string, value: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the value of the field to be greater than or equal to the specified value.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name.
|
|
|
|
* @param { ValueType } value - Indicates the String field.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the value of the field to be smaller than or equal to the specified value.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name.
|
|
|
|
* @param { ValueType } value - Indicates the String field.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the ascending order of the return list. When there are several orders,
|
|
|
|
* the one close to the head has the highest priority.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name for sorting the return list.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
orderByAsc(field: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the descending order of the return list. When there are several orders,
|
|
|
|
* the one close to the head has the highest priority.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name for sorting the return list.
|
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
orderByDesc(field: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts each row of the query result to be unique.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
distinct(): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct a query object to specify the number of results and the starting position.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { number } total - Represents the specified number of results.
|
|
|
|
* @param { number } offset - Indicates the starting position.
|
|
|
|
* @returns { DataSharePredicates } Returns the query object.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
limit(total: number, offset: number): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure {@code DataSharePredicates} to group query results by specified columns.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { Array<string> } fields - Indicates the specified columns by which query results are grouped.
|
|
|
|
* @returns { DataSharePredicates } Returns the DataSharePredicates with the specified columns by which query results are grouped.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
groupBy(fields: Array<string>): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure {@code DataSharePredicates} to specify the index column.
|
2022-11-17 08:49:05 +00:00
|
|
|
* Before using this method, you need to create an index column.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the name of the index column.
|
|
|
|
* @returns { DataSharePredicates } Returns DataSharePredicates with the specified index column.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
indexedBy(field: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure {@code DataSharePredicates} to match the specified field whose data type is ValueType array and values
|
2022-05-07 03:17:39 +00:00
|
|
|
* are within a given range.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { Array<ValueType> } value - Indicates the values to match with DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns DataSharePredicates that matches the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @StageModelOnly
|
2023-06-05 08:25:15 +00:00
|
|
|
* @since 10
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
in(field: string, value: Array<ValueType>): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure {@code DataSharePredicates} to match the specified field whose data type is String array and values
|
2022-05-07 03:17:39 +00:00
|
|
|
* are out of a given range.
|
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } field - Indicates the column name in the database table.
|
|
|
|
* @param { Array<ValueType> } value - Indicates the values to match with DataSharePredicates.
|
|
|
|
* @returns { DataSharePredicates } Returns DataSharePredicates that matches the specified field.
|
2023-03-25 08:06:25 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
notIn(field: string, value: Array<ValueType>): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure {@code DataSharePredicates} Creates a query condition using the specified key prefix.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { string } prefix - Represents the specified key prefix.
|
|
|
|
* @returns { DataSharePredicates } Returns the query object.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
|
|
|
prefixKey(prefix: string): DataSharePredicates;
|
|
|
|
|
|
|
|
/**
|
2022-11-25 11:05:48 +00:00
|
|
|
* Configure {@code DataSharePredicates} to match the specified value whose key is within a given range.
|
2022-05-07 03:17:39 +00:00
|
|
|
*
|
2023-04-07 06:32:17 +00:00
|
|
|
* @param { Array<string> } keys - Represents the key names.
|
|
|
|
* @returns { DataSharePredicates } Returns the query object.
|
2022-05-07 03:17:39 +00:00
|
|
|
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
|
2022-07-27 07:43:51 +00:00
|
|
|
* @systemapi
|
2023-01-12 07:35:55 +00:00
|
|
|
* @StageModelOnly
|
2023-03-25 08:06:25 +00:00
|
|
|
* @since 9
|
2022-05-07 03:17:39 +00:00
|
|
|
*/
|
2022-05-11 11:14:07 +00:00
|
|
|
inKeys(keys: Array<string>): DataSharePredicates;
|
2023-03-25 08:06:25 +00:00
|
|
|
}
|
2022-05-07 03:17:39 +00:00
|
|
|
}
|
2022-06-14 02:06:00 +00:00
|
|
|
|
2023-03-25 08:06:25 +00:00
|
|
|
export default dataSharePredicates;
|