From e666461e53052086c2576c809069b17c7108bd3e Mon Sep 17 00:00:00 2001 From: Adam Dry Date: Wed, 8 Jul 2015 16:53:12 +0100 Subject: [PATCH] Update README.md to show connect callback Added and example callback function to the dbWrapper.connect() function in the examples to show how to handle errors and to show that the call is async. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dc2f131..c6a0188 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,9 @@ 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(); +dbWrapper.connect(function(err) { + if (err) { console.log('Error connecting: ' + err); } +}); // ** fetchAll dbWrapper.fetchAll('SELECT * FROM user', null, function(err, result) {