úÎ!#(!     None>?] ç  rocksdb-query#Read a value from the database, or  if not found. rocksdb-query¶Use the passed key to filter all the elements whose key prefix match it. Use a sum type for keys that allows to set a version of the key that has a shorter length when serialized.. ÿí#!/usr/bin/env stack {- stack --resolver lts-12.9 --install-ghc runghc --package base --package cereal --package conduit --package rocksdb-haskell-1.0.1 --package rocksdb-query-0.1.2 -- -hide-all-packages -} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} import Conduit import Data.Serialize import Database.RocksDB (createIfMissing, defaultOptions, open) import Database.RocksDB.Query (KeyValue, insert, matching) data MyKey = ShortKey String | FullKey String String deriving Show instance Serialize MyKey where put (ShortKey a) = put a put (FullKey a b) = put a >> put b get = FullKey <$> get <*> get instance KeyValue MyKey String main = do db <- open "test-db" defaultOptions {createIfMissing = True} insert db (FullKey "hello" "world") "despite all my rage" Just record <- runResourceT . runConduit $ matching db Nothing (ShortKey "hello") .| headC print (record :: (MyKey, String))&In this example you may serialize the ShortKeyp and match all the elements in the database that start with it as a prefix. Deserializing will always yield a FullKey. rocksdb-queryLike c, but skip to the second key passed as argument, or after if there is no entry for the second key. rocksdb-query"Insert a record into the database. rocksdb-query"Delete a record from the database. rocksdb-queryGet the $ to insert a record in the database.  rocksdb-queryGet the & to delete a record from the database.  rocksdb-queryWrite a batch to the database.  rocksdb-queryLike # but return the first element only.  rocksdb-queryLike $, but return the first element only.  rocksdb-queryLike  but return a list. rocksdb-queryLike , but return a list.  Safe!      *rocksdb-query-0.1.2-3Tjb9Sh8yZI17oecbhXuycDatabase.RocksDB.QueryPaths_rocksdb_queryKeyValueKeyretrievematchRecursivematching matchingSkipinsertremoveinsertOpdeleteOp writeBatch firstMatchingfirstMatchingSkipmatchingAsListmatchingSkipAsListbaseGHC.BaseNothing,rocksdb-haskell-1.0.1-9YIZC5dllIR7X9n4Z41bPCDatabase.RocksDB.TypesBatchOpversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName