This commit wraps the errors that could, under rare a occasion,
cause a panic. Allowing for a graceful recover by select
conditions.
Please see #82 for more info
When creating an index with CreateIndex, a pattern is used to specify
the matching keys that should be stored in the index. It is therefore
unexpected that items that do not match the pattern will be presented to
the less function that is also supplied on CreateIndex. This change
corrects that problem by applying the pattern in two paths previously
not considered:
1. When an item is replaced in the database.
2. When an item is deleted from the database.
This commit allows for BuntDB to load data files that were
previously considered invalid or corrupted.
Now when the data file ends with an incomplete command, the data
will be truncated at the end of the previously success command.
Also when a null control character is encountered instead of an
asterix, which indicates the start of a command, the null is
ignored and the cursor moves to the next byte. This allows for
null padding at the head and the tail.
Fixes#71https://github.com/tidwall/tile38/issues/600
- SyncPolicy - Adjusts hoe often the data is synced to disk.
This can beNever, EverySecond, or Always. The default is EverySecond.
- AutoShrink - Controls how often the append-only log can grow before
it gets resized. The default is 5x the number of items in the database.