packages feed

libmdbx 0.1.0.2 → 0.1.0.3

raw patch · 4 files changed

+27/−19 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

app/Main.hs view
@@ -34,16 +34,23 @@ main :: IO () main = bracket openEnvDbi envClose $ \env -> do   dbi <- dbiOpen env Nothing []+   putItems env dbi pairs+   getItems env dbi keys1 >>= print @[User]   getItems env dbi keys2 >>= print @[User]   getItems env dbi (_username <$> users) >>= print @[User]+   getRange env dbi range1 range2 >>= mapM_ (print @User)+   where     keys1 = ["mark", "dale"] :: [Text]     keys2 = ["john", "carl"] :: [Text]+     range1 = "user-user-327" :: Text     range2 = "user-user-999" :: Text++    pairs = (\u -> (userKey u, u)) <$> users     users = [       User "mark" "hide",       User "john" "test",@@ -57,4 +64,3 @@       User "user-425" "test",       User "user-897" "test"       ]-    pairs = (\u -> (userKey u, u)) <$> users
libmdbx.cabal view
@@ -5,12 +5,13 @@ -- see: https://github.com/sol/hpack  name:           libmdbx-version:        0.1.0.2+version:        0.1.0.3 synopsis:       Bindings for libmdbx, an embedded key/value store description:    Haskell bindings for [libmdbx](https://github.com/erthink/libmdbx).                 .-                See documentation in the main module or check the README on GitHub at-                <https://github.com/fjvallarino/libmdbx-hs#readme>.+                See documentation in the main module or check the+                <https://github.com/fjvallarino/libmdbx-hs#readme README>+                on GitHub. category:       Database homepage:       https://github.com/fjvallarino/libmdbx-hs#readme bug-reports:    https://github.com/fjvallarino/libmdbx-hs/issues
src/Mdbx.hs view
@@ -9,16 +9,16 @@ Main module for libmdbx-hs. This is what most applications should import.  In case you only need to store, update and retrieve data, check the-`Mdbx.Database` module.+"Mdbx.Database" module. -You will also want to check `Mdbx.Types` in order to be able to store your data+You will also want to check "Mdbx.Types" in order to be able to store your data types. In general, you will also want to use a serialization library such as-[store](https://hackage.haskell.org/package/store) or-[cereal](https://hackage.haskell.org/package/cereal).+<https://hackage.haskell.org/package/store store> or+<https://hackage.haskell.org/package/cereal cereal>. -If you want fine grained control or using cursors, check `Mdbx.API`.+If you want fine grained control or using cursors, check "Mdbx.API". -The `Mdbx.FFI` (not exported by this module) provides direct, low level,+The "Mdbx.FFI" (not exported by this module) provides direct, low level, bindings to libmdbx. -} module Mdbx (
src/Mdbx/Types.hs view
@@ -35,14 +35,15 @@ Converts an instance to/from the representation needed by libmdbx. This type is used for both keys and values. -Only the Text instance is provided, since it is commonly used as the key when+Only the 'Text' instance is provided, since it is commonly used as the key when storing/retrieving a value.  For your own types, in general, you will want to use a serialization library-such as store, cereal, etc, and apply the newtype deriving via trick. +such as <https://hackage.haskell.org/package/store store>,+<https://hackage.haskell.org/package/cereal cereal>, etc, and apply the newtype+deriving via trick. -For store (this can be found in the example application), the instance can be-defined as:+The 'Data.Store.Store' instance can be defined as:  @ newtype MdbxItemStore a = MdbxItemStore {@@ -82,11 +83,11 @@ @  Note: if you plan on using a custom type as the key, be careful if it contains-Text or Bytestring instances, since these types have a length field which is,-in general, before the data. This can issues when using cursors, since those-depend on key ordering and the length field will make shorter instances lower-than longer ones, even if the content indicates the opposite. In general, it is-simpler to use Text as the key.+'Text' or 'Data.ByteString.ByteString' instances, since these types have a+length field which is, in general, before the data. This causes issues when+using cursors, since they depend on key ordering and the length field will make+shorter instances lower than longer ones, even if the content indicates the+opposite. In general, it is simpler to use 'Text' as the key. -} class MdbxItem i where   {-|