1 | "use strict";
|
2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7 | };
|
8 | var plugin_1 = require('./plugin');
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | var SQLite = (function () {
|
51 | function SQLite() {
|
52 | }
|
53 | SQLite.openDatabase = function (config) {
|
54 | return new SQLite().openDatabase(config);
|
55 | };
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | SQLite.prototype.openDatabase = function (config) {
|
64 | var _this = this;
|
65 | return new Promise(function (resolve, reject) {
|
66 | if (typeof sqlitePlugin !== 'undefined') {
|
67 | sqlitePlugin.openDatabase(config, function (db) {
|
68 | _this._objectInstance = db;
|
69 | resolve(db);
|
70 | }, function (error) {
|
71 | console.warn(error);
|
72 | reject(error);
|
73 | });
|
74 | }
|
75 | else {
|
76 | plugin_1.pluginWarn({
|
77 | pluginName: 'SQLite',
|
78 | plugin: 'cordova-sqlite-storage'
|
79 | });
|
80 | }
|
81 | });
|
82 | };
|
83 | SQLite.prototype.addTransaction = function (transaction) { };
|
84 | |
85 |
|
86 |
|
87 |
|
88 | SQLite.prototype.transaction = function (fn) { return; };
|
89 | |
90 |
|
91 |
|
92 |
|
93 | SQLite.prototype.readTransaction = function (fn) { return; };
|
94 | SQLite.prototype.startNextTransaction = function () { };
|
95 | |
96 |
|
97 |
|
98 | SQLite.prototype.close = function () { return; };
|
99 | SQLite.prototype.start = function () { };
|
100 | |
101 |
|
102 |
|
103 |
|
104 | SQLite.prototype.executeSql = function (statement, params) { return; };
|
105 | |
106 |
|
107 |
|
108 |
|
109 |
|
110 | SQLite.prototype.addStatement = function (sql, values) { return; };
|
111 | |
112 |
|
113 |
|
114 |
|
115 | SQLite.prototype.sqlBatch = function (sqlStatements) { return; };
|
116 | SQLite.prototype.abortallPendingTransactions = function () { };
|
117 | |
118 |
|
119 |
|
120 |
|
121 | SQLite.prototype.handleStatementSuccess = function (handler, response) { };
|
122 | |
123 |
|
124 |
|
125 |
|
126 | SQLite.prototype.handleStatementFailure = function (handler, response) { };
|
127 | SQLite.prototype.run = function () { };
|
128 | |
129 |
|
130 |
|
131 | SQLite.prototype.abort = function (txFailure) { };
|
132 | SQLite.prototype.finish = function () { };
|
133 | |
134 |
|
135 |
|
136 | SQLite.prototype.abortFromQ = function (sqlerror) { };
|
137 | |
138 |
|
139 |
|
140 | SQLite.echoTest = function () { return; };
|
141 | |
142 |
|
143 |
|
144 |
|
145 | SQLite.deleteDatabase = function (first) { return; };
|
146 | __decorate([
|
147 | plugin_1.InstanceProperty
|
148 | ], SQLite.prototype, "databaseFeatures", void 0);
|
149 | __decorate([
|
150 | plugin_1.CordovaInstance({
|
151 | sync: true
|
152 | })
|
153 | ], SQLite.prototype, "addTransaction", null);
|
154 | __decorate([
|
155 | plugin_1.CordovaInstance({
|
156 | successIndex: 2,
|
157 | errorIndex: 1
|
158 | })
|
159 | ], SQLite.prototype, "transaction", null);
|
160 | __decorate([
|
161 | plugin_1.CordovaInstance()
|
162 | ], SQLite.prototype, "readTransaction", null);
|
163 | __decorate([
|
164 | plugin_1.CordovaInstance({
|
165 | sync: true
|
166 | })
|
167 | ], SQLite.prototype, "startNextTransaction", null);
|
168 | __decorate([
|
169 | plugin_1.CordovaInstance()
|
170 | ], SQLite.prototype, "close", null);
|
171 | __decorate([
|
172 | plugin_1.CordovaInstance({
|
173 | sync: true
|
174 | })
|
175 | ], SQLite.prototype, "start", null);
|
176 | __decorate([
|
177 | plugin_1.CordovaInstance()
|
178 | ], SQLite.prototype, "executeSql", null);
|
179 | __decorate([
|
180 | plugin_1.CordovaInstance()
|
181 | ], SQLite.prototype, "addStatement", null);
|
182 | __decorate([
|
183 | plugin_1.CordovaInstance()
|
184 | ], SQLite.prototype, "sqlBatch", null);
|
185 | __decorate([
|
186 | plugin_1.CordovaInstance({
|
187 | sync: true
|
188 | })
|
189 | ], SQLite.prototype, "abortallPendingTransactions", null);
|
190 | __decorate([
|
191 | plugin_1.CordovaInstance({
|
192 | sync: true
|
193 | })
|
194 | ], SQLite.prototype, "handleStatementSuccess", null);
|
195 | __decorate([
|
196 | plugin_1.CordovaInstance({
|
197 | sync: true
|
198 | })
|
199 | ], SQLite.prototype, "handleStatementFailure", null);
|
200 | __decorate([
|
201 | plugin_1.CordovaInstance({
|
202 | sync: true
|
203 | })
|
204 | ], SQLite.prototype, "run", null);
|
205 | __decorate([
|
206 | plugin_1.CordovaInstance({
|
207 | sync: true
|
208 | })
|
209 | ], SQLite.prototype, "abort", null);
|
210 | __decorate([
|
211 | plugin_1.CordovaInstance({
|
212 | sync: true
|
213 | })
|
214 | ], SQLite.prototype, "finish", null);
|
215 | __decorate([
|
216 | plugin_1.CordovaInstance({
|
217 | sync: true
|
218 | })
|
219 | ], SQLite.prototype, "abortFromQ", null);
|
220 | __decorate([
|
221 | plugin_1.Cordova()
|
222 | ], SQLite, "echoTest", null);
|
223 | __decorate([
|
224 | plugin_1.Cordova()
|
225 | ], SQLite, "deleteDatabase", null);
|
226 | SQLite = __decorate([
|
227 | plugin_1.Plugin({
|
228 | pluginName: 'SQLite',
|
229 | pluginRef: 'sqlitePlugin',
|
230 | plugin: 'cordova-sqlite-storage',
|
231 | repo: 'https://github.com/litehelpers/Cordova-sqlite-storage'
|
232 | })
|
233 | ], SQLite);
|
234 | return SQLite;
|
235 | }());
|
236 | exports.SQLite = SQLite;
|
237 |
|
\ | No newline at end of file |