I’ve decided to use SQLite for my personal development project, because it just sprung up out of my computer seemingly of its own volition and I wanted to learn more about it. The problem is, I’m starting to really miss a lot of the features I’m accustomed to with heavyweight RDBMS’s: stored programs, constraints, DRI, complex datatypes like DateTime, etc.
I really like the “database as a file” concept, but I’m finding myself implementing a lot of integrity features from scratch as I go along.
So, as the title says, I’m curious: are there more features built into the product that I just don’t know about? Are there tools or libraries (preferably for .Net) that add in features as-needed? Is there another version out there that’s a little more robust?
I’m using Mono 2.4 and Mono.Data.SQLite.
There’s at least a few ways to enforce foreign key constraints. That page explains how to do it using triggers, and it links to at least two sites that will convert your normal foreign key constraint to a trigger, programmatically, for you.
Because SQLite uses manifest typing, you can store any type in any column. You don’t precisely need “complex datatypes like DateTime,” because you can store a blob (serialized data) anywhere, or you can store whatever you want as a string. Note that there are a number of datetime functions in the SQLite core as well — they just operate on numbers or strings (or both, due to automatic casting), depending on the function. There’s not a real need for a date “type” when a string suffices here. That’s one of the ways SQLite remains so small and portable.