holiman / billy

Very simple datastore
BSD 3-Clause "New" or "Revised" License
50 stars 7 forks source link

Add support for opening databases in-memory if path is empty #20

Closed karalabe closed 11 months ago

karalabe commented 11 months ago

This PR replaces the *os.File with a store interface to allow having multiple different backens. The PR also implements and integrates the in-memory backend to use if the database path given is empty.

Btw, this interface can be used by the multi-file capped PR too, would integrate nicely with very minimal changes needed.

codecov[bot] commented 11 months ago

Codecov Report

Merging #20 (2ed2086) into main (97ff6ef) will increase coverage by 0.90%. The diff coverage is 90.14%.

@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   86.18%   87.08%   +0.90%     
==========================================
  Files           3        5       +2     
  Lines         333      395      +62     
==========================================
+ Hits          287      344      +57     
- Misses         31       36       +5     
  Partials       15       15              
holiman commented 11 months ago

will decrease coverage by 2.07%.

Oh no!

holiman commented 11 months ago

I removed the Read/Write now. Wdyt?

karalabe commented 11 months ago

I removed the Read/Write now. Wdyt?

LGTM