This repository was archived by the owner on Sep 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,17 @@ angular.module('ngCordova.plugins.sqlite', [])
3434 return q . promise ;
3535 } ,
3636
37+ batch : function ( db , queries ) {
38+ var q = $q . defer ( ) ;
39+ db . sqlBatch ( queries , function ( ) {
40+ q . resolve ( ) ;
41+ } ,
42+ function ( error ) {
43+ q . reject ( error ) ;
44+ } ) ;
45+ return q . promise ;
46+ } ,
47+
3748 insertCollection : function ( db , query , bindings ) {
3849 var q = $q . defer ( ) ;
3950 var coll = bindings . slice ( 0 ) ; // clone collection
@@ -78,6 +89,18 @@ angular.module('ngCordova.plugins.sqlite', [])
7889 return q . promise ;
7990 } ,
8091
92+ closeDB : function ( db ) {
93+ var q = $q . defer ( ) ;
94+
95+ db . close ( function ( success ) {
96+ q . resolve ( success ) ;
97+ } , function ( error ) {
98+ q . reject ( error ) ;
99+ } ) ;
100+
101+ return q . promise ;
102+ } ,
103+
81104 deleteDB : function ( dbName ) {
82105 var q = $q . defer ( ) ;
83106
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ describe('Service: $cordovaSQLite', function() {
7070 expect ( result ) . toBe ( true ) ;
7171 } ) ;
7272
73- it ( 'should call errorCb when in window\'s sqlitePlugin.deleteDatabase a error orccurs' , function ( ) {
73+ it ( 'should call errorCb when in window\'s sqlitePlugin.deleteDatabase an error orccurs' , function ( ) {
7474
7575 var result ;
7676 var errorObj = { someError : 1 } ;
@@ -90,5 +90,4 @@ describe('Service: $cordovaSQLite', function() {
9090
9191 expect ( result ) . toBe ( errorObj ) ;
9292 } ) ;
93-
9493} ) ;
You can’t perform that action at this time.
0 commit comments