eladb/node-csvdb — pull request #2 by AvnerCohen (2012-11-09 21:55:22+00:00)
Title: Integrate inferify

As discussed "offline", attached is the integrated code.

I still think few things can be improved.

Following is what happens:

* If data set has less than 10 rows. old parse_value is used.
* If more than 10 rows exist, following process is used:
* pass over 10 first rows and infer type of each column.
* Derive a dedicated parsing method for each data type as provided by inferify.
* Run through complete dataset and parse data

I have also added a set of tests specifically geared at testing datatypes, a one particular test is now passing that would fail otherwise (the string "true" or "false" in a string column).

The one thing I'm not so comfortable is that to get this done I had to move all conversion to the x.on("end").. since it can not be done in a streams fashion.

Let me know what you think.

\* I have mistakenly, changed the white space configuration of the files (sorry..) you can better compare the code changes by adding "?w=1" to the end of the github url to get it to ignore whitespaces.