We can't really depend on SQLite telling us the types of columns of results - if these are from _reports, so some SQL, then SQLite doesn't preserve the type information in many cases.
So although this looks a bit hacky, it stands the best chance of consistently working as things are changed internally - a date should always come out of SQLite as a string in the format YYYY-MM-DD, and if something is in that format, it should be treated as a date.
We can't really depend on SQLite telling us the types of columns of results - if these are from _reports, so some SQL, then SQLite doesn't preserve the type information in many cases.
So although this looks a bit hacky, it stands the best chance of consistently working as things are changed internally - a date should always come out of SQLite as a string in the format YYYY-MM-DD, and if something is in that format, it should be treated as a date.