btrask / stronglink

A searchable, syncable, content-addressable notetaking system
Other
1.04k stars 39 forks source link

Schema layer improvements #12

Open btrask opened 9 years ago

btrask commented 9 years ago

db_schema_* API for verifying that the application schema matches the stored data. This should be separate from the database schema version that we store currently. It should be forward-compatible for changes that support it. We need to store column names and types. Types should be stored as strings for maximum extensibility.

It'd also be nice to have a blob/buffer type. With escaping instead of length-prefixing, that way we could handle truncated hash URIs easily (assuming we switch to hash normalization).

btrask commented 9 years ago

Considering using the varint format from SQLite4: https://www.sqlite.org/src4/doc/trunk/www/varint.wiki

Our current varint format can only pack values 0-15 into one byte. This hits us on every key's table ID.