code: function final(err,response){
    			if(err){$scope.errmsg = "Server error, please try again.";console.log({error:err})}
    			if(response){
    				//console.log(response);
    				$scope.smod = false;
    				delete $rootScope.mdb.sqls[$scope.savecsql.queryname]
    				delete $rootScope.mdb.esqls[$scope.savecsql.queryname]
    				var newrec = angular.copy($scope.csql)
    				$rootScope.mdb.esqls[$scope.csql.queryname] = newrec;
    				newrec.dbs   = newrec.db;
    				newrec.inuse = false;
    				$scope.csql.inuse = false;
    				$scope.runtestmsg = "";
    				$rootScope.mdb.queries.forEach(function(item){
    					if (item.id == $scope.csql.id){
    						item.queryname = $scope.csql.queryname;
    						item.inuse = false;
    						
    						$scope.qsel(item);
    					};
    				});
    			}
    		}
docs: console.log("SQL SAVE");