{"action":"opened","issue":{"url":"https://api.github.com/repos/brianc/node-postgres/issues/1151","repository_url":"https://api.github.com/repos/brianc/node-postgres","labels_url":"https://api.github.com/repos/brianc/node-postgres/issues/1151/labels{/name}","comments_url":"https://api.github.com/repos/brianc/node-postgres/issues/1151/comments","events_url":"https://api.github.com/repos/brianc/node-postgres/issues/1151/events","html_url":"https://github.com/brianc/node-postgres/issues/1151","id":183018411,"number":1151,"title":"Confused: connect or not to connect?","user":{"login":"davidgatti","id":411114,"avatar_url":"https://avatars.githubusercontent.com/u/411114?v=3","gravatar_id":"","url":"https://api.github.com/users/davidgatti","html_url":"https://github.com/davidgatti","followers_url":"https://api.github.com/users/davidgatti/followers","following_url":"https://api.github.com/users/davidgatti/following{/other_user}","gists_url":"https://api.github.com/users/davidgatti/gists{/gist_id}","starred_url":"https://api.github.com/users/davidgatti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidgatti/subscriptions","organizations_url":"https://api.github.com/users/davidgatti/orgs","repos_url":"https://api.github.com/users/davidgatti/repos","events_url":"https://api.github.com/users/davidgatti/events{/privacy}","received_events_url":"https://api.github.com/users/davidgatti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-14T10:38:15Z","updated_at":"2016-10-14T10:38:15Z","closed_at":null,"body":"Hello, \r\n\r\nIn the project that I'm working on, instead of using Sequalize I decided to do old school, since the project is small. This means I'm spending lots of time in this repo 👻 😋. And I'm confused how to talk with the DB. \r\n\r\nOn the main README.md I read:\r\n\r\n> //call `done()` to release the client back to the pool\r\n\r\nSo my brain assumes that not only I have to do `connect()` at each request, but I also have to release the connection. Sounds fine to me.\r\n\r\nBut then I go hear https://github.com/brianc/node-postgres/wiki/Query, and suddenly no `connection()`, and no _release_ to be seen in the top part of the document. \r\n\r\nIn my code I made queries using both options and they work, but since I don't see the difference I don't know which one to chose :)\r\n\r\nHow should I talk with the DB? 😎 To many options, and not enough explanation on the differences between all this approaches.\r\n\r\nWhat I'm looking for:\r\n\r\n- to write as little code as possible\r\n- to have code that can handle 10,000 request a minute for example. \r\n- to reuse the open connection as much as possible.\r\n\r\nWhich aproceh will give the best results? \r\n"}}
{"actor":{"display_login":"davidgatti"}}