-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Monadic interface for TokyoTyrant. -- -- This package provides simple monadic interface for TokyoTyrant. @package monarch @version 0.2.0.0 -- | This module provide TokyoTyrant monadic access interface. -- -- TokyoTyrant Original Binary -- Protocol(http://fallabs.com/tokyotyrant/spex.html#protocol) is -- implemented. module Database.Monarch -- | A monad supporting TokyoTyrant access. data Monarch a -- | Run Monarch with TokyoTyrant at target host and port. runMonarch :: MonadIO m => String -> Int -> Monarch a -> m (Either Code a) -- | Options for scripting extension data ExtOption -- | record locking RecordLocking :: ExtOption -- | global locking GlobalLocking :: ExtOption -- | Options for restore data RestoreOption -- | consistency checking ConsistencyChecking :: RestoreOption -- | Options for miscellaneous operation data MiscOption -- | omission of update log NoUpdateLog :: MiscOption -- | Error code data Code Success :: Code InvalidOperation :: Code HostNotFound :: Code ConnectionRefused :: Code SendError :: Code ReceiveError :: Code ExistingRecord :: Code NoRecordFound :: Code MiscellaneousError :: Code -- | Store a record. If a record with the same key exists in the database, -- it is overwritten. put :: ByteString -> ByteString -> Monarch () -- | Store a new record. If a record with the same key exists in the -- database, this function has no effect. putKeep :: ByteString -> ByteString -> Monarch () -- | Concatenate a value at the end of the existing record. If there is no -- corresponding record, a new record is created. putCat :: ByteString -> ByteString -> Monarch () -- | Concatenate a value at the end of the existing record and shift it to -- the left. If there is no corresponding record, a new record is -- created. putShiftLeft :: ByteString -> ByteString -> Int -> Monarch () -- | Store a record without response. If a record with the same key exists -- in the database, it is overwritten. putNoResponse :: ByteString -> ByteString -> Monarch () -- | Remove a record. out :: ByteString -> Monarch () -- | Retrieve a record. get :: ByteString -> Monarch (Maybe ByteString) -- | Retrieve records. multipleGet :: [ByteString] -> Monarch [(ByteString, ByteString)] -- | Get the size of the value of a record. valueSize :: ByteString -> Monarch (Maybe Int) -- | Initialize the iterator. iterInit :: Monarch () -- | Get the next key of the iterator. The iterator can be updated by -- multiple connections and then it is not assured that every record is -- traversed. iterNext :: Monarch (Maybe ByteString) -- | Get forward matching keys. forwardMatchingKeys :: ByteString -> Int -> Monarch [ByteString] -- | Add an integer to a record. If the corresponding record exists, the -- value is treated as an integer and is added to. If no record -- corresponds, a new record of the additional value is stored. addInt :: ByteString -> Int -> Monarch Int -- | Add a real number to a record. If the corresponding record exists, the -- value is treated as a real number and is added to. If no record -- corresponds, a new record of the additional value is stored. addDouble :: ByteString -> Double -> Monarch Double -- | Call a function of the script language extension. ext :: ByteString -> [ExtOption] -> ByteString -> ByteString -> Monarch ByteString -- | Synchronize updated contents with the file and the device. sync :: Monarch () -- | Optimize the storage. optimize :: ByteString -> Monarch () -- | Remove all records. vanish :: Monarch () -- | Copy the database file. copy :: ByteString -> Monarch () -- | Restore the database file from the update log. restore :: Integral a => ByteString -> a -> [RestoreOption] -> Monarch () -- | Set the replication master. setMaster :: Integral a => ByteString -> Int -> a -> [RestoreOption] -> Monarch () -- | Get the number of records. recordNum :: Monarch Int64 -- | Get the size of the database. size :: Monarch Int64 -- | Get the status string of the database. status :: Monarch ByteString -- | Call a versatile function for miscellaneous operations. misc :: ByteString -> [MiscOption] -> [ByteString] -> Monarch [ByteString] instance Eq Code instance Show Code instance Functor Monarch instance Applicative Monarch instance Monad Monarch instance MonadIO Monarch instance MonadError Code Monarch instance BitFlag32 MiscOption instance BitFlag32 RestoreOption instance BitFlag32 ExtOption instance Error Code