@capacitor-community/sqlite 3.5.2-dev1 → 3.5.2-dev2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -786,7 +786,7 @@ public class Database {
786
786
  throw new Exception(e.getMessage());
787
787
  }
788
788
  } else {
789
- throw new Exception("No last_modified column in tables");
789
+ throw new Exception("No last_modified/sql_deleted columns in tables");
790
790
  }
791
791
  } else {
792
792
  retObj.put("changes", Integer.valueOf(0));
@@ -891,10 +891,13 @@ public class Database {
891
891
  inJson.setEncrypted(_encrypted);
892
892
  inJson.setMode(mode);
893
893
  try {
894
- // set the last export date
895
- Date date = new Date();
896
- long syncTime = date.getTime() / 1000L;
897
- toJson.setLastExportDate(this, syncTime);
894
+ boolean isSyncTable = _uJson.isTableExists(this, "sync_table");
895
+ if (isSyncTable) {
896
+ // set the last export date
897
+ Date date = new Date();
898
+ long syncTime = date.getTime() / 1000L;
899
+ toJson.setLastExportDate(this, syncTime);
900
+ }
898
901
  // launch the export process
899
902
  JsonSQLite retJson = toJson.createExportObject(this, inJson);
900
903
  // retJson.print();
@@ -3509,7 +3509,7 @@ class Database {
3509
3509
  }
3510
3510
  }
3511
3511
  else {
3512
- throw new Error('No last_modified column in tables');
3512
+ throw new Error('No last_modified/sql_deleted columns in tables');
3513
3513
  }
3514
3514
  }
3515
3515
  else {
@@ -3768,7 +3768,10 @@ class Database {
3768
3768
  inJson.mode = mode;
3769
3769
  this.ensureDatabaseIsOpen();
3770
3770
  try {
3771
- await this.exportToJsonUtil.setLastExportDate(this.database, new Date().toISOString());
3771
+ const isTable = await this.jsonUtil.isTableExists(this.database, this._isDbOpen, 'sync_table');
3772
+ if (isTable) {
3773
+ await this.exportToJsonUtil.setLastExportDate(this.database, new Date().toISOString());
3774
+ }
3772
3775
  const jsonResult = await this.exportToJsonUtil.createExportObject(this.database, inJson);
3773
3776
  const keys = Object.keys(jsonResult);
3774
3777
  if (keys.length === 0) {