code: function connect(options) {
    // Default driver is MySQL.
    activeBackend = options.driver || 'mysql';
  
    // Save the connection options for later use.
    connectionOptions = options;
  
    if (activeBackend === 'mysql') {
      // Save a reference to the MySQL client object for later use.
      activeDb = mysql.createClient(options);
  
      if (activeDb !== null) {
        activeDb.on('error', function (err) {
          console.log(err);
        });
      }
    }
  
    return activeDb;
  }
docs: db_connect() as in Drupal 6.
  
  This is much more complex with PDO in Drupal 7, which we won't try to
  emulate here.