1/* 2 * Copyright (c) 2021 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 */ 15import {AsyncCallback, Callback} from './basic'; 16import { ResultSet as _ResultSet } from './data/rdb/resultSet'; 17import Context from "./application/BaseContext"; 18 19/** 20 * Provides methods for rdbStore create and delete. 21 * 22 * @since 7 23 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 24 * @import import data_rdb from '@ohos.data.rdb'; 25 */ 26declare namespace rdb { 27 /** 28 * Obtains an RDB store. 29 * 30 * You can set parameters of the RDB store as required. In general, this method is recommended 31 * to obtain a rdb store. 32 * 33 * @note N/A 34 * @since 7 35 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 36 * @param context Indicates the context of application or capability. 37 * @param config Indicates the configuration of the database related to this RDB store. The configurations include 38 * the database path, storage mode, and whether the database is read-only. 39 * @param version Indicates the database version for upgrade or downgrade. 40 * @return Returns an RDB store {@link ohos.data.rdb.RdbStore}. 41 */ 42 function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback<RdbStore>): void; 43 function getRdbStore(context: Context, config: StoreConfig, version: number): Promise<RdbStore>; 44 45 /** 46 * Deletes the database with a specified name. 47 * 48 * @note N/A 49 * @since 7 50 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 51 * @param context Indicates the context of application or capability. 52 * @param name Indicates the database name. 53 * @return Returns true if the database is deleted; returns false otherwise. 54 */ 55 function deleteRdbStore(context: Context, name: string, callback: AsyncCallback<void>): void; 56 function deleteRdbStore(context: Context, name: string): Promise<void>; 57 58 /** 59 * Indicates the database synchronization mode. 60 * 61 * @since 8 62 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 63 * @import N/A 64 */ 65 enum SyncMode { 66 /** 67 * Indicates the data is pushed to remote device from local device. 68 * 69 * @since 8 70 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 71 * @import N/A 72 */ 73 SYNC_MODE_PUSH = 0, 74 75 /** 76 * Indicates the data is pulled from remote device to local device. 77 * 78 * @since 8 79 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 80 * @import N/A 81 */ 82 SYNC_MODE_PULL = 1, 83 } 84 85 /** 86 * Describes the subscription type. 87 * 88 * @since 8 89 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 90 * @import N/A 91 */ 92 enum SubscribeType { 93 /** 94 * Subscription to remote data changes 95 * @since 8 96 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 97 * @import N/A 98 */ 99 SUBSCRIBE_TYPE_REMOTE = 0, 100 } 101 102 /** 103 * Provides methods for managing the relational database (RDB). 104 * 105 * This class provides methods for creating, querying, updating, and deleting RDBs. 106 * 107 * @since 7 108 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 109 * @import import data_rdb from '@ohos.data.rdb'; 110 */ 111 interface RdbStore { 112 /** 113 * Inserts a row of data into the target table. 114 * 115 * @note N/A 116 * @since 7 117 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 118 * @param name Indicates the target table. 119 * @param values Indicates the row of data to be inserted into the table. 120 * @return Returns the row ID if the operation is successful; returns -1 otherwise. 121 */ 122 insert(name: string, values: ValuesBucket, callback: AsyncCallback<number>): void; 123 insert(name: string, values: ValuesBucket): Promise<number>; 124 125 /** 126 * Updates data in the database based on a a specified instance object of rdbPredicates. 127 * 128 * @note N/A 129 * @since 7 130 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 131 * @param values Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. 132 * @param rdbPredicates Indicates the specified update condition by the instance object of RdbPredicates. 133 * @return Returns the number of affected rows. 134 */ 135 update(values: ValuesBucket, rdbPredicates: RdbPredicates, callback: AsyncCallback<number>): void; 136 update(values: ValuesBucket, rdbPredicates: RdbPredicates): Promise<number>; 137 138 /** 139 * Deletes data from the database based on a specified instance object of rdbPredicates. 140 * 141 * @note N/A 142 * @since 7 143 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 144 * @param rdbPredicates Indicates the specified delete condition by the instance object of RdbPredicates. 145 * @return Returns the number of affected rows. 146 */ 147 delete(rdbPredicates: RdbPredicates, callback: AsyncCallback<number>): void; 148 delete(rdbPredicates: RdbPredicates): Promise<number>; 149 150 /** 151 * Queries data in the database based on specified conditions. 152 * 153 * @note N/A 154 * @since 7 155 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 156 * @param rdbPredicates Indicates the specified query condition by the instance object of RdbPredicates. 157 * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. 158 * @return Returns a ResultSet object if the operation is successful; 159 */ 160 query(rdbPredicates: RdbPredicates, columns: Array<string>, callback: AsyncCallback<ResultSet>): void; 161 query(rdbPredicates: RdbPredicates, columns?: Array<string>): Promise<ResultSet>; 162 163 /** 164 * Queries data in the database based on SQL statement. 165 * 166 * @note N/A 167 * @since 8 168 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 169 * @param sql Indicates the SQL statement to execute. 170 * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. 171 * @return Returns a ResultSet object if the operation is successful; 172 */ 173 querySql(sql: string, bindArgs: Array<ValueType>, callback: AsyncCallback<ResultSet>): void; 174 querySql(sql: string, bindArgs?: Array<ValueType>): Promise<ResultSet>; 175 176 /** 177 * Executes an SQL statement that contains specified parameters but returns no value. 178 * 179 * @note N/A 180 * @since 7 181 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 182 * @param sql Indicates the SQL statement to execute. 183 * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. 184 */ 185 executeSql(sql: string, bindArgs: Array<ValueType>, callback: AsyncCallback<void>): void; 186 executeSql(sql: string, bindArgs?: Array<ValueType>): Promise<void>; 187 188 /** 189 * beginTransaction before excute your sql 190 * 191 * @note N/A 192 * @since 8 193 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 194 */ 195 beginTransaction():void; 196 197 /** 198 * commit the the sql you have excuted. 199 * 200 * @note N/A 201 * @since 8 202 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 203 */ 204 commit():void; 205 206 /** 207 * roll back the sql you have already excuted 208 * 209 * @note N/A 210 * @since 8 211 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 212 */ 213 rollBack():void; 214 215 /** 216 * Set table to be distributed table. 217 * 218 * @note N/A 219 * @since 8 220 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 221 * @param tables the tables name you want to set 222 */ 223 setDistributedTables(tables: Array<string>, callback: AsyncCallback<void>): void; 224 setDistributedTables(tables: Array<string>): Promise<void>; 225 226 /** 227 * Obtain distributed table name of specified remote device according to local table name. 228 * When query remote device database, distributed table name is needed. 229 * 230 * @note N/A 231 * @since 8 232 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 233 * @param device Indicates the remote device. 234 * @param table Indicates the local table name. 235 * @return the distributed table name. 236 237 */ 238 obtainDistributedTableName(device: string, table: string, callback: AsyncCallback<string>): void; 239 obtainDistributedTableName(device: string, table: string): Promise<string>; 240 241 /** 242 * Sync data between devices 243 * 244 * @note N/A 245 * @since 8 246 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 247 * @param mode Indicates the synchronization mode. The value can be PUSH, PULL. 248 * @param predicates Constraint synchronized data and devices. 249 * @param callback Indicates the callback used to send the synchronization result to the caller. 250 251 */ 252 sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback<Array<[string, number]>>): void; 253 sync(mode: SyncMode, predicates: RdbPredicates): Promise<Array<[string, number]>>; 254 255 /** 256 * Registers a observer for the database. When data in the distributed database changes, 257 * the callback will be invoked. 258 * 259 * @note N/A 260 * @since 8 261 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 262 * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. 263 * @param observer Indicates the observer of data change events in the distributed database. 264 */ 265 on(event: 'dataChange', type: SubscribeType, observer: Callback<Array<string>>): void; 266 267 /** 268 * Remove specified observer of specified type from the database. 269 * 270 * @note N/A 271 * @since 8 272 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 273 * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. 274 * @param observer Indicates the data change observer already registered . 275 */ 276 off(event:'dataChange', type: SubscribeType, observer: Callback<Array<string>>): void; 277 } 278 279 /** 280 * Indicates possible value types 281 * 282 * @since 7 283 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 284 * @import import data_rdb from '@ohos.data.rdb'; 285 */ 286 type ValueType = number | string | boolean; 287 288 /** 289 * Values in buckets are stored in key-value pairs 290 * 291 * @since 7 292 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 293 * @import import data_rdb from '@ohos.data.rdb'; 294 */ 295 type ValuesBucket = { 296 [key: string]: ValueType | Uint8Array | null; 297 } 298 299 /** 300 * Manages relational database configurations. 301 * 302 * @since 7 303 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 304 * @import import data_rdb from '@ohos.data.rdb'; 305 */ 306 interface StoreConfig { 307 name: string; 308 } 309 310 /** 311 * Manages relational database configurations. 312 * 313 * @since 7 314 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 315 * @import import data_rdb from '@ohos.data.rdb'; 316 */ 317 class RdbPredicates { 318 /** 319 * A parameterized constructor used to create an RdbPredicates instance. 320 * name Indicates the table name of the database. 321 * 322 * @note N/A 323 * @since 7 324 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 325 */ 326 constructor(name: string) 327 328 /** 329 * Specify remote devices when syncing distributed database. 330 * 331 * @note When query database, this function should not be called. 332 * @since 8 333 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 334 * @param devices Indicates specified remote devices. 335 * @return Returns the RdbPredicates self. 336 */ 337 inDevices(devices: Array<string>): RdbPredicates; 338 339 /** 340 * Specify all remote devices which connect to local device when syncing distributed database. 341 * 342 * @note When query database, this function should not be called. 343 * @since 8 344 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 345 * @return Returns the RdbPredicates self. 346 */ 347 inAllDevices(): RdbPredicates; 348 349 /** 350 * Configures the RdbPredicates to match the field whose data type is ValueType and value is equal 351 * to a specified value. 352 * 353 * @note This method is similar to = of the SQL statement. 354 * @since 7 355 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 356 * @param field Indicates the column name in the database table. 357 * @param value Indicates the value to match with the RdbPredicates. 358 * @return Returns the RdbPredicates that match the specified field. 359 */ 360 equalTo(field: string, value: ValueType): RdbPredicates; 361 362 /** 363 * Configures the RdbPredicates to match the field whose data type is ValueType and value is unequal to 364 * a specified value. 365 * 366 * @note This method is similar to != of the SQL statement. 367 * @since 7 368 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 369 * @param field Indicates the column name in the database table. 370 * @param value Indicates the value to match with the RdbPredicates. 371 * @return Returns the RdbPredicates that match the specified field. 372 */ 373 notEqualTo(field: string, value: ValueType): RdbPredicates; 374 375 /** 376 * Adds a left parenthesis to the RdbPredicates. 377 * 378 * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). 379 * @since 7 380 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 381 * @return Returns the RdbPredicates with the left parenthesis. 382 */ 383 beginWrap(): RdbPredicates; 384 385 /** 386 * Adds a right parenthesis to the RdbPredicates. 387 * 388 * @note This method is similar to ) of the SQL statement and needs to be used together 389 * with beginWrap(). 390 * @since 7 391 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 392 * @return Returns the RdbPredicates with the right parenthesis. 393 */ 394 endWrap(): RdbPredicates; 395 396 /** 397 * Adds an or condition to the RdbPredicates. 398 * 399 * @note This method is similar to or of the SQL statement. 400 * @since 7 401 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 402 * @return Returns the RdbPredicates with the or condition. 403 */ 404 or(): RdbPredicates; 405 406 /** 407 * Adds an and condition to the RdbPredicates. 408 * 409 * @note This method is similar to and of the SQL statement. 410 * @since 7 411 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 412 * @return Returns the RdbPredicates with the and condition. 413 */ 414 and(): RdbPredicates; 415 416 /** 417 * Configures the RdbPredicates to match the field whose data type is string and value 418 * contains a specified value. 419 * 420 * @note This method is similar to contains of the SQL statement. 421 * @since 7 422 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 423 * @param field Indicates the column name in the database table. 424 * @param value Indicates the value to match with the RdbPredicates. 425 * @return Returns the RdbPredicates that match the specified field. 426 */ 427 contains(field: string, value: string): RdbPredicates; 428 429 /** 430 * Configures the RdbPredicates to match the field whose data type is string and value starts 431 * with a specified string. 432 * 433 * @note This method is similar to value% of the SQL statement. 434 * @since 7 435 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 436 * @param field Indicates the column name in the database table. 437 * @param value Indicates the value to match with the RdbPredicates. 438 * @return Returns the RdbPredicates that match the specified field. 439 */ 440 beginsWith(field: string, value: string): RdbPredicates; 441 442 /** 443 * Configures the RdbPredicates to match the field whose data type is string and value 444 * ends with a specified string. 445 * 446 * @note This method is similar to %value of the SQL statement. 447 * @since 7 448 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 449 * @param field Indicates the column name in the database table. 450 * @param value Indicates the value to match with the RdbPredicates. 451 * @return Returns the RdbPredicates that match the specified field. 452 */ 453 endsWith(field: string, value: string): RdbPredicates; 454 455 /** 456 * Configures the RdbPredicates to match the fields whose value is null. 457 * 458 * @note This method is similar to is null of the SQL statement. 459 * @since 7 460 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 461 * @param field Indicates the column name in the database table. 462 * @return Returns the RdbPredicates that match the specified field. 463 */ 464 isNull(field: string): RdbPredicates; 465 466 /** 467 * Configures the RdbPredicates to match the specified fields whose value is not null. 468 * 469 * @note This method is similar to is not null of the SQL statement. 470 * @since 7 471 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 472 * @param field Indicates the column name in the database table. 473 * @return Returns the RdbPredicates that match the specified field. 474 */ 475 isNotNull(field: string): RdbPredicates; 476 477 /** 478 * Configures the RdbPredicates to match the fields whose data type is string and value is 479 * similar to a specified string. 480 * 481 * @note This method is similar to like of the SQL statement. 482 * @since 7 483 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 484 * @param field Indicates the column name in the database table. 485 * @param value Indicates the value to match with the RdbPredicates. The percent sign (%) in the value 486 * is a wildcard (like * in a regular expression). 487 * @return Returns the RdbPredicates that match the specified field. 488 */ 489 like(field: string, value: string): RdbPredicates; 490 491 /** 492 * Configures RdbPredicates to match the specified field whose data type is string and the value contains 493 * a wildcard. 494 * 495 * @note Different from like, the input parameters of this method are case-sensitive. 496 * @since 7 497 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 498 * @param field Indicates the column name in the database table. 499 * @param value Indicates the value to match with RdbPredicates. 500 * @return Returns the SQL statement with the specified RdbPredicates. 501 */ 502 glob(field: string, value: string): RdbPredicates; 503 504 /** 505 * Restricts the value of the field to the range between low value and high value. 506 * 507 * @note N/A 508 * @since 7 509 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 510 * @param field Indicates the column name. 511 * @param low Indicates the minimum value. 512 * @param high Indicates the maximum value. 513 * @return Returns the SQL query statement with the specified RdbPredicates. 514 */ 515 between(field: string, low: ValueType, high: ValueType): RdbPredicates; 516 517 /** 518 * Configures RdbPredicates to match the specified field whose data type is int and value is 519 * out of a given range. 520 * 521 * @note N/A 522 * @since 7 523 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 524 * @param field Indicates the column name in the database table. 525 * @param low Indicates the minimum value to match with DataAbilityPredicates. 526 * @param high Indicates the maximum value to match with DataAbilityPredicates. 527 * @return Returns the SQL query statement with the specified RdbPredicates. 528 */ 529 notBetween(field: string, low: ValueType, high: ValueType): RdbPredicates; 530 531 /** 532 * Restricts the value of the field to be greater than the specified value. 533 * 534 * @note N/A 535 * @since 7 536 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 537 * @param field Indicates the column name. 538 * @param value Indicates the String field. 539 * @return Returns the SQL query statement with the specified RdbPredicates. 540 */ 541 greaterThan(field: string, value: ValueType): RdbPredicates; 542 543 /** 544 * Restricts the value of the field to be smaller than the specified value. 545 * 546 * @note N/A 547 * @since 7 548 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 549 * @param field Indicates the column name. 550 * @param value Indicates the String field. 551 * @return Returns the SQL query statement with the specified RdbPredicates. 552 */ 553 lessThan(field: string, value: ValueType): RdbPredicates; 554 555 /** 556 * Restricts the value of the field to be greater than or equal to the specified value. 557 * 558 * @note N/A 559 * @since 7 560 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 561 * @param field Indicates the column name. 562 * @param value Indicates the String field. 563 * @return Returns the SQL query statement with the specified RdbPredicates. 564 */ 565 greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicates; 566 567 /** 568 * Restricts the value of the field to be smaller than or equal to the specified value. 569 * 570 * @note N/A 571 * @since 7 572 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 573 * @param field Indicates the column name. 574 * @param value Indicates the String field. 575 * @return Returns the SQL query statement with the specified RdbPredicates. 576 */ 577 lessThanOrEqualTo(field: string, value: ValueType): RdbPredicates; 578 579 /** 580 * Restricts the ascending order of the return list. When there are several orders, 581 * the one close to the head has the highest priority. 582 * 583 * @note N/A 584 * @since 7 585 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 586 * @param field Indicates the column name for sorting the return list. 587 * @return Returns the SQL query statement with the specified RdbPredicates. 588 */ 589 orderByAsc(field: string): RdbPredicates; 590 591 /** 592 * Restricts the descending order of the return list. When there are several orders, 593 * the one close to the head has the highest priority. 594 * 595 * @note N/A 596 * @since 7 597 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 598 * @param field Indicates the column name for sorting the return list. 599 * @return Returns the SQL query statement with the specified RdbPredicates. 600 */ 601 orderByDesc(field: string): RdbPredicates; 602 603 /** 604 * Restricts each row of the query result to be unique. 605 * 606 * @note N/A 607 * @since 7 608 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 609 * @return Returns the SQL query statement with the specified RdbPredicates. 610 */ 611 distinct(): RdbPredicates; 612 613 /** 614 * Restricts the max number of return records. 615 * 616 * @note N/A 617 * @since 7 618 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 619 * @param value Indicates the max length of the return list. 620 * @return Returns the SQL query statement with the specified RdbPredicates. 621 */ 622 limitAs(value: number): RdbPredicates; 623 624 /** 625 * Configures RdbPredicates to specify the start position of the returned result. 626 * 627 * @note Use this method together with limit(int). 628 * @since 7 629 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 630 * @param rowOffset Indicates the start position of the returned result. The value is a positive integer. 631 * @return Returns the SQL query statement with the specified AbsPredicates. 632 */ 633 offsetAs(rowOffset: number): RdbPredicates; 634 635 /** 636 * Configures RdbPredicates to group query results by specified columns. 637 * 638 * @note N/A 639 * @since 7 640 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 641 * @param fields Indicates the specified columns by which query results are grouped. 642 * @return Returns the RdbPredicates with the specified columns by which query results are grouped. 643 */ 644 groupBy(fields: Array<string>): RdbPredicates; 645 646 /** 647 * Configures RdbPredicates to specify the index column. 648 * 649 * @note Before using this method, you need to create an index column. 650 * @since 7 651 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 652 * @param indexName Indicates the name of the index column. 653 * @return Returns RdbPredicates with the specified index column. 654 */ 655 indexedBy(field: string): RdbPredicates; 656 657 /** 658 * Configures RdbPredicates to match the specified field whose data type is ValueType array and values 659 * are within a given range. 660 * 661 * @note N/A 662 * @since 7 663 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 664 * @param field Indicates the column name in the database table. 665 * @param values Indicates the values to match with RdbPredicates. 666 * @return Returns RdbPredicates that matches the specified field. 667 */ 668 in(field: string, value: Array<ValueType>): RdbPredicates; 669 670 /** 671 * Configures RdbPredicates to match the specified field whose data type is ValueType array and values 672 * are out of a given range. 673 * 674 * @note N/A 675 * @since 7 676 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core 677 * @param field Indicates the column name in the database table. 678 * @param values Indicates the values to match with RdbPredicates. 679 * @return Returns RdbPredicates that matches the specified field. 680 */ 681 notIn(field: string, value: Array<ValueType>): RdbPredicates; 682 } 683 684 export type ResultSet = _ResultSet 685} 686 687export default rdb; 688