From 8704591b2fda87587b5564faa5629b75eeb53d3b Mon Sep 17 00:00:00 2001 From: mangtsang Date: Thu, 6 Jan 2022 09:15:08 +0800 Subject: [PATCH] added querySql interface Signed-off-by: mangtsang --- api/@ohos.data.rdb.d.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index df961acd5e..0d65d6d755 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -121,7 +121,21 @@ declare namespace rdb { * @return Returns a ResultSet object if the operation is successful; */ query(rdbPredicates: RdbPredicates, columns: Array, callback: AsyncCallback): void; - query(rdbPredicates: RdbPredicates, columns: Array): Promise; + query(rdbPredicates: RdbPredicates, columns?: Array): Promise; + + /** + * Queries data in the database based on SQL statement. + * + * @note N/A + * @since 8 + * @sysCap SystemCapability.Data.DATA_APPDATAMGR + * @devices phone, tablet, tv, wearable, car + * @param sql Indicates the SQL statement to execute. + * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. + * @return Returns a ResultSet object if the operation is successful; + */ + querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + querySql(sql: string, bindArgs?: Array): Promise; /** * Executes an SQL statement that contains specified parameters but returns no value. @@ -134,7 +148,7 @@ declare namespace rdb { * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. */ executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; - executeSql(sql: string, bindArgs: Array): Promise; + executeSql(sql: string, bindArgs?: Array): Promise; /** * change the encrypted key(not null) if the database is configured with encrypted key. -- Gitee