CodeFoodPixels / node-promise-mysql

A wrapper for mysqljs/mysql that wraps function calls with Bluebird promises.
MIT License
338 stars 64 forks source link

#51 updated README with connection.end() #52

Closed tomsaleeba closed 7 years ago

tomsaleeba commented 7 years ago

I removed the connection variable outside the promise scope where it wasn't needed because I don't think it's of any use. You can't put the .end() call after (and outside) the promise handlers, connection won't be defined.

I tried to keep your code style. I've been doing the standardJS style recently so I have to prompt myself to add the commas :thinking: .

I'm not 100% sure what I've done with the last example works because if the promise gets rejected before the first then() block then connection will be undefined. Hopefully checking if the connection exists and has end is enough.

Lastly, I didn't touch the pool stuff because I didn't use it so I don't know what's required, if anything. I figure the pool handles the connections anyway.

CodeFoodPixels commented 7 years ago

Looks good, thanks!