DroidScript does not encourage the use of anonymous functions because it leads to messy and unreadable code (which is difficult for beginners to understand), but if you are desperate to do that then here is the source code to the ExecuteSQL method which you can modify to allow anonymous callbacks. It might be useful to see this code anyway because it shows you how to use transactions too:-
db.ExecuteSql = function( sql, params, success, error )
{
db.transaction( function(tx) {
tx.executeSql( sql, params,
function(tx,res) { if(success) success.apply(db,[res]) },
function(t,e) { error.apply(db,[e.message]); }
); }, error
);
}
Here is the source to the full wrapper object which you could modify for you needs as required (just paste this code into your app and rename the 'this.' at the front of this method to 'app.' and it will override the original :-
this.OpenDatabase = function( name )
{
_LoadScriptSync( "/Sys/cp.js" );
_LoadScriptSync( "/Sys/sql.js" );
_CreateCP( "sqliteplugin" );
var db = sqlitePlugin.openDatabase( name );
db.GetType = function() { return "Database"; }
db.GetName = function() { return
db.name; }
db.ExecuteSql = function( sql, params, success, error )
{
db.transaction( function(tx) {
tx.executeSql( sql, params,
function(tx,res) { if(success) success.apply(db,[res]) },
function(t,e) { error.apply(db,[e.message]); }
); }, error
);
}
db.Close = function() { db.close( _Log, _Err ); }
db.Delete = function() { sqlitePlugin.deleteDatabase(
db.name,_Log,_Err); }
return db;
}