3 ms·
SQLite has a powerful data-validation function for each column, look for CHECK Constraints: https://www.sqlite.org/lang_createtable.html https://www.sqlite.org/
by dotancohen 5y ago
SQLite has a powerful data-validation function for each column, look for CHECK Constraints:
https://www.sqlite.org/lang_createtable.html https://www.sqlite.org/lang_createtable.html
But the real nice thing is that SQLite will allow spreadsheet-like behaviour by allowing one to enter an invalid data type. I could check that in Python or I can store it and warn "Invalid type blah blah blah". This will make life easier for those coming from a spreadsheet, or importing data. As the program matures, I can reevaluate what to do with invalid data as a default and what options to give the user.
Additionally, because SQLite allows arbitrary data in any column, adding support for e.g. formulae is greatly simplified.