This repository has been archived by the owner. It is now read-only.
Browse files

Tweak to the README

Not sure if this is necessary, but it seems that calling
DbWrapper.connect() is the magic that really makes things happen.
Tweaked the README to show where that might take place and included the
info in the list of API functions.
  • Loading branch information...
mlaccetti committed Sep 6, 2012
1 parent a3a6d2d commit 384bf59f4ea43db7886ccc404a16b176cf6e8725
Showing with 2 additions and 1 deletion.
  1. +2 −1
@@ -25,7 +25,7 @@ var dbConnectionConfig = { host: 'localhost', user: 'test', password: 'test', da
// Replace the adapter name with "mysql", "mysql-libmysqlclient", "sqlite3" or "pg" on the following line :
dbWrapper = new DBWrapper( '[DB engine adapter name]', dbConnectionConfig );
// ** fetchAll
dbWrapper.fetchAll('SELECT * FROM user', null, function(err, result) {
@@ -107,6 +107,7 @@ See the unit tests in the "test/" folder for more examples.
The __DBWrapper__ Javascript class, which is the only visible part on top on the different database engines adapters, provides the following methods :
+ * __connect()__ : tell DbWrapper to connect to the database.
* __fetchAll( sql, bind, callback )__ : fetches all SQL result rows as a Array.
* __fetchRow( sql, bind, callback )__ : fetches the first row of the SQL result.
* __fetchCol( sql, bind, callback )__ : fetches the first column of all SQL result rows as an Array.

0 comments on commit 384bf59

Please sign in to comment.