muesli-0.1.1.0: A simple document-oriented database

Copyright(c) 2015 Călin Ardelean
LicenseMIT
MaintainerCălin Ardelean <calinucs@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • MonoLocalBinds
  • ScopedTypeVariables
  • TypeFamilies
  • KindSignatures
  • ExplicitNamespaces
  • ExplicitForAll

Database.Muesli.Backend.File

Description

Binary seekable file backend that uses Prelude functions.

Only one process at a time can safely use the files, but file locking is not yet implemented.

Synopsis

Documentation

data FileHandle Source

newtype wrapper around Handle, so that we can accomodate other instances.

data FileLogState Source

Implements a stateful binary log file backend.

It uses a FileHandle for both the log and data files.

Constructors

FileLogState 

Fields

flogHandle :: FileHandle

The Handle for the log file

flogPos :: DocAddress

Current valid position in the (quasi)append-only log file. Located at address 0 of the log file, it is the last write performd as part of a batch logAppend operation, which makes it atomic.

flogSize :: DocSize

Current size of the log file. logAppend first checks the file size and increases it with minimum 4KB if necessary, then writes the records, and then updates the flogPos.