   constructor: () ->
 
   connect: (cb) ->
-    connectionString = process.env.DATABASE_URL or 'postgres://postgres:h0l1b4by@localhost:5432/lendme'
+    connectionString = process.env.DATABASE_URL or 'postgres://postgres:root@localhost:5432/lendme'
     client = new (pg.Client)(connectionString)
     client.connect()
     cb? client


  new_request:(client, params, cb) ->
    id = crypto.createHash('md5').update(this.hash()).digest 'hex' #query que revisa el numero de solicitudes pendientes que tiene un usuario (quizas usar un if para ver si es necesario hacerlo?)
    query = client.query "SELECT COALESCE ((SELECT COUNT(user_id) FROM \"Request\" WHERE user_id ='#{params.user_id}' AND state_req_id = '3' GROUP BY user_id),0)" (err, res) ->
      if not err
        if res.rows[0].count(*) > 5 && res.rows[0].type_com_id = '1' #checkeo de si supera el maximo de solicitudes 
          #Notificar
          cb? "Ha superado el máximo de solicitudes"
        else      

  constructor: () ->

  connect: (cb) ->
    connectionString = process.env.DATABASE_URL or 'postgres://postgres:root@localhost:5432/lendme'
    client = new (pg.Client)(connectionString)
    client.connect()
    cb? client
