1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Electron, Mobile: Created alarm service and drivers

This commit is contained in:
Laurent Cozic
2017-11-27 22:50:46 +00:00
parent 748acdf03f
commit 9a40851c77
26 changed files with 367 additions and 85 deletions

View File

@ -2,6 +2,10 @@ const SQLite = require('react-native-sqlite-storage');
class DatabaseDriverReactNative {
constructor() {
this.lastInsertId_ = null;
}
open(options) {
//SQLite.DEBUG(true);
return new Promise((resolve, reject) => {
@ -45,6 +49,7 @@ class DatabaseDriverReactNative {
exec(sql, params = null) {
return new Promise((resolve, reject) => {
this.db_.executeSql(sql, params, (r) => {
if ('insertId' in r) this.lastInsertId_ = r.insertId;
resolve(r);
}, (error) => {
reject(error);
@ -52,6 +57,10 @@ class DatabaseDriverReactNative {
});
}
lastInsertId() {
return this.lastInsertId_;
}
}
module.exports = { DatabaseDriverReactNative };