Empty Cell Values as Null
I use Spout for reading Excel files and importing them to a MySQL database. By default, empty cells will be returned as empty strings. If these cells belong to a numerical column, I need to convert them to null, in order to insert the row into the database. Otherwise I'm trying to insert a string value into a numerical column.
To avoid the need of replacing all empty strings with null, it would be helpful to either be able to specify how empty cells should be treated, or to return null as default for empty numerical cell types.
Hi @hallosascha, that's a great suggestion. I thought about it when I worked on #331 but ended up using empty string to avoid a breaking change.
Your use case requires null values to be inserted in the DB instead of empty strings but other developers may have a DB where columns can't be null and therefore they would have to convert all null values into empty strings. So there's no perfect solution here.
However, from a conceptual perspective, I think that null represents better the absence of value than an empty string so I'd rather use null. Unfortunately, as I mentioned before, I had to keep using empty strings for backwards compatibility.
Adding an option seems overkill so for now, you'll have to convert empty strings into null.