Permalink
Browse files

persistence.sync.js now keeps track of changes to all entities in

_Change table.
  • Loading branch information...
Zef Hemel Zef Hemel
Zef Hemel authored and Zef Hemel committed Apr 10, 2010
1 parent fced2de commit d61084e64c29d32beae6ef31f7a1e7c2dd45bc66
Showing with 77 additions and 28 deletions.
  1. +5 −2 README.md
  2. +3 −0 persistence.js
  3. +17 −17 persistence.min.js
  4. +52 −9 persistence.sync.js
View
@@ -68,7 +68,7 @@ lacks `__defineGetter__` and `__defineSetter__` support, which
Connecting to a database
-------------------------
-Currently there is one global database connection, which is
+There is one global database connection, which is
initialized with a `persistence.connect` call. Its first argument is
the database name, the second a database description and third the
maximum database size (in bytes):
@@ -220,7 +220,7 @@ explicitly call `persistence.flush()`. The exception to this rule is
using the `list(...)` method on a database `QueryCollection`, which also
flushes first, although this behavior may change in the future.
-Dumping (and restoring) a database
+Dumping and restoring data
--------------------------------
`persistence.dump` can be used to create an object containing a full
@@ -252,6 +252,9 @@ transaction. Note that `persistence.load` does not empty the database
first, it simply attempts to add all objects to the database. If
objects with, e.g. the same ID already exist, this will fail.
+Similarly, `persistence.loadFromJson` and `persistence.dumpToJson`
+respectively load and dump all the database's data as JSON strings.
+
Query collections
-----------------
View
@@ -33,6 +33,9 @@ var persistence = window.persistence || {};
persistence.trackedObjects = trackedObjects;
+ persistence.getObjectsToRemove = function() { return objectsToRemove; }
+ persistence.getTrackedObjects = function() { return trackedObjects; }
+
/**
* Retrieves metadata about entity, mostly for internal use
*/
Oops, something went wrong.

0 comments on commit d61084e

Please sign in to comment.