There were a few things that were worth mentioning that I did not like about the native Erlang MySQL module. But mostly I’m quite happy with it.
The biggest thing that I did not like was the fact that it returns everything as strings. It gives you the column information and tell you that it’s a long or a double or whatever, but the data is still a string.
I wrote a function into my wrapper that looks at the column information and casts it to an appropriate type based on what was in MySQL. Occasionally I have to recast it, but it is mostly when it is a string in the database and I was to use the information as an atom.
I also had most of my code based off the ”list of tuples” design from the OTP ODBC application. The native MySQL module uses a ”list of lists” design, so while I was recasting things about I also changed the list into a tuple. This is minor to me, as it was really just to prevent rewriting a lot of my code.
The single greatest advantage to using this module is connection pooling. That alone will save my MySQL server tons of new connections and logins.