lib/db.js
function getClient(callback) {
  if (!connectionOptions) {
    callback('Connection options missing. Please call db.connect before any other database functions to configure the database configuration');
  }

  if (activeBackend === 'mysql') {
    if (activeDb) {
      return callback(null, activeDb);
    }
    else {
      connect(connectionOptions);
      return callback(null, activeDb);
    }
  }
  else if (activeBackend === 'pgsql') {
    return pg.connect(connectionOptions, callback);
  }
}
function getClient(callback) {
  if (!connectionOptions) {
    callback('Connection options missing. Please call db.connect before any other database functions to configure the database configuration');
  }

  if (activeBackend === 'mysql') {
    if (activeDb) {
      return callback(null, activeDb);
    }
    else {
      connect(connectionOptions);
      return callback(null, activeDb);
    }
  }
  else if (activeBackend === 'pgsql') {
    return pg.connect(connectionOptions, callback);
  }
}
function getClient ( callback ) { if ( ! connectionOptions ) { callback ( 'Connection options missing. Please call db.connect before any other database functions to configure the database configuration' ) ; } if ( activeBackend === 'mysql' ) { if ( activeDb ) { return callback ( null , activeDb ) ; } else { connect ( connectionOptions ) ; return callback ( null , activeDb ) ; } } else if ( activeBackend === 'pgsql' ) { return pg . connect ( connectionOptions , callback ) ; } }
Get the client object for the current database connection.
Get the client object for the current database connection .