Permalink
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 README.md
  2. +12 −8 docs/backend.mysql.md
View
@@ -1,13 +1,21 @@
persistence.js
==============
`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](http://code.google.com/apis/gears/gears_init.js),
-in case you want to enable Gears support.
+`persistence.js` may also be used on the server, in particular in
+[node.js](http://nodejs.org) 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/backend.mysql.md` 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](http://code.google.com/apis/gears/gears_init.js), in case you
+want to enable Gears support.
About asynchronous programming
------------------------------
View
@@ -1,25 +1,29 @@
-persistence.backend.mysql.md
+Node.js MySQL Back-end
============================
This library implements some wrappers to let `persistence.js` work
with a MySQL database in a [node.js](http://nodejs.org) environment.
Although not fully stable it is usable at this point using
[nodejs-mysql-native](http://github.com/sidorares/nodejs-mysql-native)
library (which you have to download and include in your project
-manually).
+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`.
Setup
-----
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.