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

Merge pull request #9 from mlaccetti/master

Updated the README to include connect() info
  • Loading branch information...
DrBenton committed Sep 6, 2012
2 parents a3a6d2d + 384bf59 commit 4c165ad9790bccc26f2d57ca461e74cd96fed122
Showing with 2 additions and 1 deletion.
  1. +2 −1 README.md
View
@@ -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 );
-
+dbWrapper.connect();
// ** 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 4c165ad

Please sign in to comment.