Skip to content

Commit

Permalink
fix issue#504&#509 & update to jeep-sqlite2.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jepiqueau committed Jan 25, 2024
1 parent a6aa6ce commit 42aa6a4
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 18 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 5.5.2 (2024-01-25)

### Chore

- Update to jeep-sqlite@2.5.8


### Bug Fixes

- Fix exportToJson getSchema PRIMARY
- Fix allow exportToJson when mode equals "full" and no "sync_table"
- Fix out of memory since 1.9.0 issue#509 by upgrading sql.js to release 1.10.2

# 5.5.1 (2024-01-22)

### Bug Fixes
Expand Down
Binary file modified android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,10 @@ public JSObject exportToJson(String mode, Boolean isEncrypted) throws Exception
long syncTime = date.getTime() / 1000L;
toJson.setLastExportDate(this, syncTime);
} else {
throw new Exception("No sync_table available");
}
if(inJson.getMode().equals("partial")) {
throw new Exception("No sync_table available");
}
}
// launch the export process
JsonSQLite retJson = toJson.createExportObject(this, inJson);
// retJson.print();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private ArrayList<JsonColumn> getSchema(String sqlStmt) throws Exception {
String pk = sc.substring(oPar + 1, cPar);
row[0] = "CPK_" + pk.replaceAll("§", "_");
row[0] = row[0].replaceAll("_ ", "_");
row[1] = sc.substring(cPar + 2);
row[1] = sc.substring(0,cPar + 1);
jsonRow.setConstraint(row[0]);
}
case "CONSTRAINT" -> {
Expand Down
4 changes: 3 additions & 1 deletion electron/src/electron-utils/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,9 @@ export class Database {
new Date().toISOString(),
);
} else {
throw new Error(`No sync_table available`);
if (inJson.mode === 'partial') {
throw new Error(`No sync_table available`);
}
}
let jsonResult: any = this.exportToJsonUtil.createExportObject(
this.database,
Expand Down
4 changes: 3 additions & 1 deletion ios/Plugin/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,9 @@ class Database {
// Set the last exported date
try ExportToJson.setLastExportDate(mDB: self, sTime: syncTime)
} else {
throw DatabaseError.exportToJson(message: "No sync_table available")
if expMode == "partial" {
throw DatabaseError.exportToJson(message: "No sync_table available")
}
}
// Launch the export process
let data: [String: Any] = [
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@
}
},
"dependencies": {
"jeep-sqlite": "^2.5.7"
"jeep-sqlite": "^2.5.8"
}
}

0 comments on commit 42aa6a4

Please sign in to comment.