   uri = "postgres://#{config.user}:#{config.password}@#{config.host}:#{config.port}/#{config.database}"
   console.log "Connecting to URI '#{uri}'"
 
-  pgConnect uri
+  pgConnect uri, config
   .then (context) ->
     context.watch = durations.stopwatch().start()
     console.log "Ready to query PostgreSQL."

    database: config.database
  console.log "Connecting to database:\n'#{JSON.stringify(myCfg)}'"

  mysqlConnect myCfg
  .then (context) ->
    context.watch = durations.stopwatch().start()
    console.log "Ready to query MySQL."

          deferred.reject error
  deferred.promise

mysqlConnect = (mysqlConfig, config) ->
  deferred = Q.defer()
  console.log "connecting to MySQL..."
  connectWatch = durations.stopwatch().start()
  connection = mysql.mysql.createConnection mysqlConfig
  connection.connect (error) ->
    if error
      console.log "Error connecting to MySQL:", error, "\nStack:\n", error.stack
