feat(cordova-plugin-unvired-sdk): Add dbDeleteWithArgs, dbUpdateWithArgs, and dbExecuteStatementWithArgs methods, and deprecate their non-argument counterparts.

This commit is contained in:
Venkadesh P
2026-02-26 11:40:16 +05:30
committed by Daniel Sogl
parent 355d5b3028
commit 6bb7bd6397
@@ -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<DbResult> {
@@ -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<DbResult> {
@@ -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<DbResult> {
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<DbResult> {
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<DbResult> {
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<DbResult> {
return;
}
/**
* Create Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
*