Add Database userVersion getter/setter

For getting/setting the PRAGMA user_version.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add protection around foreign key constraints

SQLite3 disables foreign key constraints by default. Let's throw an
assertion to alert developers when they create a constraint with a
connection that hasn't enabled them.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Throw assertions for all non-constraint-based errors

Even constraint failures can be programmer error, so we probably want to
revisit this in the future.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>