I currently have a method to see what type of object an input is and create a SQL input based on it, Like so:
private static string PropertyToDBString(object o)
{
Debug.Log(o.GetType());
if (o == typeof(System.String) || o == typeof(string))
return "'" + o.ToString() + "'";
else if (o == typeof(System.Boolean) || o == typeof(bool))
return ((System.Boolean)o) ? "1" : "0";
return "'" + o.ToString() + "'";
}
But this does not seem to work, Everything returns as .toString() based, Boolean return as True/False, but the log is picking up the type as system.boolean. Like so:
I'm using SQLite and wondering if I should bother using proper data types, As limits don't exist and even the fact the boolean column is INT(1) on the DB but still stores True/False. Should I just use TEXT for everything.