Commit Graph

6 Commits

Author SHA1 Message Date
projectmoon bf4ce24b79 Better public API for user variables, avoid allocations in Context.
The database API for user variables has changed somewhat again, this
time closer to the proper vision. There are now two separate sled
Trees in the Variables struct, one for user-defined variables, and one
for counts. Keys have been changed to be username-first, then room ID.
The signatures of the functions now also use a strongly-typed struct,
UserAndRoom.

As part of this, the Context object now once again avoids allocating
new strings.

Other random changes included here:
 - Remove tempfile crate in favor of sled temporary db config.
 - Add bincode crate in anticipation of future (de)serializing.
2020-11-03 20:31:29 +00:00
projectmoon 7e15379c58 Migrate existing delineators to delimiter 0xfe. 2020-11-01 19:08:54 +00:00
projectmoon 9f598541fb Remove variable_count keys missed in manual data migration. 2020-10-30 22:44:19 +00:00
projectmoon 5224357f8b Add migration 2: remove old data. 2020-10-30 21:53:22 +00:00
projectmoon 3cec676b2f Clean up migration to make it more readable 2020-10-30 21:53:22 +00:00
projectmoon a53ce85f38 Add db migration support, change variables schema.
This is a bit of a large commit that adds basic database migration
support. It also alters the way user variables are stored in a way
requiring manual migration of existing data. The first automated
migration adds variable count in a new place.
2020-10-30 21:53:22 +00:00