Browse files

Documentation tweaks to accomodate for server environments.

  • Loading branch information...
1 parent 9abae95 commit 1b2c01365769b5427974273abc9625389133c19d @zefhemel zefhemel committed Jul 13, 2010
Showing with 24 additions and 12 deletions.
  1. +12 −4
  2. +12 −8 docs/
@@ -1,13 +1,21 @@
`persistence.js` is a simple asynchronous Javascript object-relational
-mapper library. It works with the in-browser HTML5 SQLite database as
+mapper library. In the browser it works with the HTML5 SQLite database as
well as Google Gears' local data store. It may be used to develop
offline-capable web applications.
-It has no dependencies on any other frameworks, other than the Google
-Gears [initialization script](,
-in case you want to enable Gears support.
+`persistence.js` may also be used on the server, in particular in
+[node.js]( environments. The support for this is
+currently under heavy development. There is currently a MySQL back-end
+available. The API to be used in node.js is slightly different than
+described in this README, be sure to check out the
+`docs/` document to see how it differs.
+For browser use, `persistence.js` has no dependencies on any other
+frameworks, other than the Google Gears [initialization
+script](, in case you
+want to enable Gears support.
About asynchronous programming
@@ -1,25 +1,29 @@
+Node.js MySQL Back-end
This library implements some wrappers to let `persistence.js` work
with a MySQL database in a [node.js]( environment.
Although not fully stable it is usable at this point using
library (which you have to download and include in your project
+manually). This library is a starting point to start adding more
+back-ends to `persistence.js`, including NoSQL back-ends.
-Use of `persistence.js` is slightly modified to deal with multiple
-concurrent session in the node.js application. A `Session` object needs
-to be passed as an extra argument to certain method calls, typically
-as a last argument. Methods usually called on the `persistence` object
-itself are now called on the `Session` object.
+Sadly the node.js server environment requires slight changes to
+`persistence.js` to make it work with multiple database connections:
+* A `Session` object needs to be passed as an extra argument to
+ certain method calls, typically as a last argument.
+* Methods previously called on the `persistence` object itself are now
+ called on the `Session` object.
An example node.js application is included in `test/node-blog.js`.
You need to `require` two modules, the `persistence.js` library itself
-and the MySQL backend module:
+and the MySQL backend module. Also make sure the MySQL library
+is located (or symlinked) from the current directory:
var persistence = require('./persistence').persistence;
var persistenceBackend = require('./persistence.backend.mysql');

0 comments on commit 1b2c013

Please sign in to comment.