1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Sync fixes

This commit is contained in:
Laurent Cozic
2017-07-19 20:15:55 +01:00
parent df3e5ac40c
commit 5ca8647d35
18 changed files with 264 additions and 99 deletions

View File

@ -166,6 +166,11 @@ class Database {
throw new Error('Unknown enum type or id: ' + type + ', ' + id);
}
static enumIds(type) {
if (type == 'syncTarget') return [1,2,3];
throw new Error('Unknown enum type: ' + type);
}
static formatValue(type, value) {
if (value === null || value === undefined) return null;
if (type == this.TYPE_INT) return Number(value);
@ -182,7 +187,8 @@ class Database {
var line = lines[i];
if (line == '') continue;
if (line.substr(0, 2) == "--") continue;
statement += line;
statement += line.trim();
if (line[line.length - 1] == ',') statement += ' ';
if (line[line.length - 1] == ';') {
output.push(statement);
statement = '';