Eonblast/Emysql — pull request #122 by jkingsbery (2014-03-01 05:23:51+00:00)
Title: add_pool/k for k>2

First stab at some of the low hanging fruit on #111
* Refactor to use add_pool/2
* Refactored unit tests to primarily used add_pool/2
* Kept unit tests (and marked as deprecated in test name) for existing add_pool to ensure compatibility

A couple further suggestions:
* The environment test suite should be split into two: one suite for testing the creation of pools, and one for operations that use pools once created
* The default encoding for add_pool/2 was utf8, but based on the unit test the default encoding for the other add_pools was latin1. I had it as latin1 to keep existing unit tests happy, but it seems better for the default to be utf8.
* There could be an add_pool/1 that takes a pool record and creates it. I've refactored using an intermediate record to be able to use guards to check the types of things easily, but it would be better still if that was all done in add_pool/1 and add_pool/2 would just pass things in to the record.