(function(e,c,d){var b="Rho.Database";var a=d.apiReqFor(b);function f(){var g=null;this.getId=function(){return g};if(1==arguments.length&&arguments[0][d.rhoIdParam()]){if(b!=arguments[0][d.rhoClassParam()]){throw"Wrong class instantiation!"}g=arguments[0][d.rhoIdParam()]}else{g=d.nextId()}}d.createPropsProxy(f.prototype,[],a,function(){return this.getId()});d.createMethodsProxy(f.prototype,[],a,function(){return this.getId()});d.createRawPropsProxy(f.prototype,[]);d.createPropsProxy(f,[],a);d.createMethodsProxy(f,[],a);d.namespace(b,f)})(Rho.jQuery,Rho,Rho.util);(function(d,b,c){var a="Rho.Database";var f=function(g,j,i,h){return(j===undefined)?[]:g.execute(j,i,h)};function e(){var g=null;this.getId=function(){return g};if(1==arguments.length&&arguments[0][c.rhoIdParam()]){if(a!=arguments[0][c.rhoClassParam()]){throw"Wrong class instantiation!"}g=arguments[0][c.rhoIdParam()]}else{g=c.nextId();this.initialize.apply(this,arguments)}}e.prototype.initialize=function(g,h){this.dbPath=g;this.db=new Rho.Database.SQLite3(g,h)};e.prototype.close=function(){if(this.db===null){return false}this.db.close();this.dbPath=null;this.db=null;return true};e.prototype.startTransaction=function(){this.db.startTransaction()};e.prototype.commitTransaction=function(){this.db.commitTransaction()};e.prototype.rollbackTransaction=function(){this.db.rollbackTransaction()};e.prototype.lockDb=function(){this.db.lockDb()};e.prototype.unlockDb=function(){this.db.unlockDb()};e.prototype.isUiWaitForDb=function(){return this.db.isUiWaitForDb()};e.prototype.executeSql=function(h,g){return f(this.db,h,false,g)};e.prototype.executeBatchSql=function(g){return f(this.db,g,true,[])};e.prototype.destroyTable=function(g){this.db.destroyTables([g],[])};e.prototype.destroyTables=function(g){this.db.destroyTables(g.include,g.exclude)};e.prototype.isTableExist=function(g){return this.db.isTableExist(g)};e.prototype.setDoNotBackupAttribute=function(g){g=(g===undefined)?true:g;if(Rho.System.getProperty("platform")==="APPLE"){Rho.System.setDoNotBackupAttribute(this.dbPath,g);Rho.System.setDoNotBackupAttribute(this.dbPath+".version",g)}};c.namespace(a,e,true)})(Rho.jQuery,Rho,Rho.util);