Using the bundled SQLite session extension, changesets can be generated that track changes to data, which can then be represented in a blob. Here's how the Extralite API might look:
changeset = db.track_changes(:foo, :bar) do |cs|
cs.attach(:baz) # attach more tables
db << "insert into foo values (1, 2, 3)"
end
# iterate through changes
changeset.each { |c| p c }
# get all changes
changeset.to_a
# get changeset blob
changeset.to_blob
# get patchset
changeset.to_blob_patchset
# load from blob
changeset = Extralite::Changeset.new(blob)
# invert
changeset.invert(db)
# apply to DB
changeset.apply(db)
Using the bundled SQLite session extension, changesets can be generated that track changes to data, which can then be represented in a blob. Here's how the Extralite API might look: