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

FoundationDB.Internal.Bindings

Description

Raw bindings to the underlying C client API. These are not memory safe. For documentation, see https://apple.github.io/foundationdb/api-c.html.

Synopsis

API versioning

currentAPIVersion :: Int Source #

Current version of the installed FDB library. For example, returns 630 if you are using FoundationDB client 6.3.x.

Network

Future

newtype Future a Source #

Constructors

Future (Ptr (Future a)) 

Instances

Instances details
Show (Future a) Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Methods

showsPrec :: Int -> Future a -> ShowS #

show :: Future a -> String #

showList :: [Future a] -> ShowS #

Storable (Future a) Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Methods

sizeOf :: Future a -> Int #

alignment :: Future a -> Int #

peekElemOff :: Ptr (Future a) -> Int -> IO (Future a) #

pokeElemOff :: Ptr (Future a) -> Int -> Future a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Future a) #

pokeByteOff :: Ptr b -> Int -> Future a -> IO () #

peek :: Ptr (Future a) -> IO (Future a) #

poke :: Ptr (Future a) -> Future a -> IO () #

Database

Transaction

data KeySelector Source #

Specifies a key in the database. See the official docs for more information. These can be supplied to getKey or used to build a Range.

Constructors

LastLessThan ByteString

Selects the lexicographically greatest key less than the specified key.

LastLessOrEq ByteString

Selects the lexicographically greatest less than or equal to the specified key.

FirstGreaterThan ByteString

Selects the lexicographically least key greater than the specified key.

FirstGreaterOrEq ByteString

Selects the lexicographically least key greater than or equal to the specified key.

WithOffset Int KeySelector

offsets a key selector. Using offset is preferred, since it handles normalization to prevent nested WithOffsets.

keySelectorTuple :: KeySelector -> (ByteString, Bool, Int) Source #

Convert a KeySelector to its or_equal, offset settings. Equivalent to the macros FDB_KEYSEL_LAST_LESS_THAN etc.

transactionGetRange Source #

Arguments

:: Transaction 
-> KeySelector

begin

-> KeySelector

end

-> Int

max number of pairs to return

-> Int

max number of bytes to return

-> FDBStreamingMode 
-> Int

if FDBStreamingMode is FdbStreamingModeIterator, start this at 1 and increment by for each successive call reading this range. Otherwise, ignored.

-> Bool

isSnapshotRead

-> Bool

whether to return pairs in reverse order

-> IO (Future [(ByteString, ByteString)]) 

data FDBStreamingMode Source #

Instances

Instances details
Bounded FDBStreamingMode Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Enum FDBStreamingMode Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Eq FDBStreamingMode Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Ord FDBStreamingMode Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Show FDBStreamingMode Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

data FDBConflictRangeType Source #

Instances

Instances details
Enum FDBConflictRangeType Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Eq FDBConflictRangeType Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Ord FDBConflictRangeType Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Show FDBConflictRangeType Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Error

isError :: CFDBError -> Bool Source #

Return True iff CFDBError value is an error (non-zero).

data FDBErrorPredicate Source #

Instances

Instances details
Enum FDBErrorPredicate Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Eq FDBErrorPredicate Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Ord FDBErrorPredicate Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

Show FDBErrorPredicate Source # 
Instance details

Defined in FoundationDB.Internal.Bindings

data MappedKeyValue Source #

The result of a mapped key value query, containing the parent key and value (i.e., the key and value in the secondary index), and the range of key-value pairs retrieved based on the range query generated from the mapper's operation on the parent key and value.

WARNING: FDB's docs warn that the returned KeySelector fields have not yet been tested. Use them at your own risk!

getMappedRangeResult :: Future [MappedKeyValue] -> IO (Either CFDBError ([MappedKeyValue], Bool)) Source #

Extracts the mappedKeyValue results from the future, along with a bool indicating whether more results are available.

transactionGetMappedRange Source #

Arguments

:: Transaction 
-> KeySelector

begin

-> KeySelector

end

-> ByteString

Mapper name

-> Int

max number of pairs to return

-> Int

max number of bytes to return

-> FDBStreamingMode 
-> Int

if FDBStreamingMode is FdbStreamingModeIterator, start this at 1 and increment by for each successive call reading this range. Otherwise, ignored.

-> Bool

isSnapshotRead

-> Bool

whether to return pairs in reverse order

-> IO (Future [MappedKeyValue])