evanmiller/boss_db — pull request #42 by davebcn (2012-10-17 11:27:40+00:00)
Title: Support date type on mysql adapter

Hi guys,

we're facing the case of having date types columns on our mysql schema.

We don't have a date type on boss_db , I guess because on erlang we deal only with datetimes and now-like structure.

Storing dates and query using them is working if you pad them as datetimes ({Date, {0,0,0}}) so no problem here.

The only problem is when you try to read or update an already present element that includes a date type row. We got something like that

[{boss_db_adapter_mysql,pack_value,
[{date,{2012,7,31}}],
[{file,"src/db_adapters/boss_db_adapter_mysql.erl"},
{line,422}]},

I added support for this case so when we recover a date value from mysql db is gracefully translated to their datetime version.