First make sure you have ngCordova properly installed. (install instructions can be found on ngcordova website), along with the named plugin.
When you get undefined error you should always look if you have the dependency defined. That is the most common mistake with people starting with AngularJS.
Example code:
//inject your dependencies;
ControllerOrConfigFunction.$inject = ["$scope", "$cordovaSQLite"]
function ControllerOrConfigFunction($scope,$cordovaSQLite){
//your code here
}
This applies to all functions in which you are using the $cordovaSQLite plugin.
You can also find a great example on ngCordova website.
There are multiple ways you can define your Dependency Injection in AngularJs, i recommend it for now, after that take a look at ng-annotate.
openDatabasefunction? - Davide Pastore