foundationdb-haskell-0.1.0.0: FoundationDB C client bindings
Safe HaskellNone
LanguageHaskell2010

FoundationDB.Layer.Subspace

Description

Subspaces allow you to easily attach a common prefix to tuple-encoded keys (See FoundationDB.Layer.Tuple) so that you can perform range reads and deletes over a set of related keys.

The subspace layer is one of the standard layers supported by all language bindings. See the official documentation for more information.

Synopsis

Creating subspaces

newtype Subspace Source #

Represents a subspace of Tuple keys. A subspace is just a common prefix for a set of tuples.

Constructors

Subspace 

Instances

Instances details
Eq Subspace Source # 
Instance details

Defined in FoundationDB.Layer.Subspace

Ord Subspace Source # 
Instance details

Defined in FoundationDB.Layer.Subspace

Show Subspace Source # 
Instance details

Defined in FoundationDB.Layer.Subspace

subspace Source #

Arguments

:: [Elem]

Tuple with which to prefix the subspace. May not contain incomplete version stamps.

-> Subspace 

Create a subspace from a tuple.

prefixedSubspace Source #

Arguments

:: ByteString

prefix

-> [Elem] 
-> Subspace 

Create a subspace from a raw bytestring prefix and a tuple.

Using subspaces

extend :: Subspace -> [Elem] -> Subspace Source #

Create a subsubspace by extending the prefix of a subspace by the given tuple.

pack :: Subspace -> [Elem] -> ByteString Source #

Encode a tuple prefixed with a subspace.

unpack :: Subspace -> ByteString -> Either String [Elem] Source #

Decode a tuple that was encoded by pack.

contains Source #

Arguments

:: Subspace 
-> ByteString

encoded key

-> Bool 

Returns True iff the subspace contains the given key.

subspaceRangeQuery :: Subspace -> RangeQuery Source #

Construct a range query that covers an entire subspace.

getLast :: Subspace -> Transaction (Maybe (ByteString, ByteString)) Source #

Get the last key,value pair in the subspace, if it exists.

subspaceKey :: Subspace -> ByteString Source #

Returns the bytestring prefix of the subspace. Equivalent to rawPrefix. This function is provided for consistency with other language bindings.