sqlite backing

This patch provides a way to back the diffs with sqlite.