From 6bb7bd639773bf4a5c6c14f0fbf8f050c311af11 Mon Sep 17 00:00:00 2001 From: Venkadesh P Date: Thu, 26 Feb 2026 11:40:16 +0530 Subject: [PATCH] feat(cordova-plugin-unvired-sdk): Add `dbDeleteWithArgs`, `dbUpdateWithArgs`, and `dbExecuteStatementWithArgs` methods, and deprecate their non-argument counterparts. --- .../plugins/unvired-cordova-sdk/index.ts | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts index c5359550f..54cc86a5e 100644 --- a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts +++ b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts @@ -1025,6 +1025,7 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { * # Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56 * this.unviredSDK.dbDelete('FORM_HEADER', "FORM_ID = '5caed815892215034dacad56'") * ``` + * @deprecated Use `dbDeleteWithArgs` instead. */ @Cordova() dbDelete(tableName: string, whereClause: any): Promise { @@ -1043,6 +1044,7 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { * # Update NAME & NO from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56 * this.unviredSDK.dbUpdate('FORM_HEADER', {"NAME":"UPDATED_USER","UPDATED_NO":"0039"}, "FORM_ID = '5caed815892215034dacad56'") * ``` + * @deprecated Use `dbUpdateWithArgs` instead. */ @Cordova() dbUpdate(tableName: string, updatedObject: any, whereClause: any): Promise { @@ -1057,12 +1059,65 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { * ``` * this.unviredSDK.dbExecuteStatement("SELECT * FROM CUSTOMER_HEADER WHERE CUSTOMER_ID = '39'") * ``` + * @deprecated Use `dbExecuteStatementWithArgs` instead. */ @Cordova() dbExecuteStatement(query: string): Promise { return; } + /** + * Delete records from the database. + * + * @param tableName Name of the table + * @param whereClause {Object} Browser: JSON object containing name-value pairs. + * Mobile: Or a Sqlite whereClause ( without the 'where' keyword ) + * @param args Arguments to replace the '?' placeholders in the query if any + * Example: + * ``` + * # Delete values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56 + * this.unviredSDK.dbDeleteWithArgs('FORM_HEADER', "FORM_ID = ?", ['5caed815892215034dacad56']) + * ``` + */ + @Cordova() + dbDeleteWithArgs(tableName: string, whereClause: any, args: any[]): Promise { + return; + } + + /** + * Update records in database. + * + * @param tableName Name of the table + * @param updatedObject JSON object containing updated name-value pairs. + * @param whereClause {Object} Browser: JSON object containing name-value pairs. + * Mobile: Or a Sqlite where Clause ( without the 'where' keyword ) + * @param args Arguments to replace the '?' placeholders in the query if any + * Example: + * ``` + * # Update NAME & NO from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56 + * this.unviredSDK.dbUpdateWithArgs('FORM_HEADER', {"NAME":"UPDATED_USER","UPDATED_NO":"0039"}, "FORM_ID = ?", ['5caed815892215034dacad56']) + * ``` + */ + @Cordova() + dbUpdateWithArgs(tableName: string, updatedObject: any, whereClause: any, args: any[]): Promise { + return; + } + + /** + * Execute a SQL statement + * + * @param query {string} SQL Statement. + * @param args Arguments to replace the '?' placeholders in the query if any + * Example: + * ``` + * this.unviredSDK.dbExecuteStatementWithArgs("SELECT * FROM CUSTOMER_HEADER WHERE CUSTOMER_ID = ?", ['39']) + * ``` + */ + @Cordova() + dbExecuteStatementWithArgs(query: string, args: any[]): Promise { + return; + } + /** * Create Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html ) *