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

FoundationDB

Description

This module contains all of the basics needed to build a program that interacts with FoundationDB. The documentation throughout this library assumes that you have already read the official developer guide.

Quick start

Synopsis

Initialization

currentAPIVersion :: Int Source #

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

withFoundationDB :: FoundationDBOptions -> (Database -> IO a) -> IO a Source #

Handles correctly starting up the network connection to the DB. Can only be called once per process! Throws an Error if any part of setting up the connection to FoundationDB fails.

data FoundationDBOptions Source #

Options set at the connection level for FoundationDB.

Constructors

FoundationDBOptions 

Fields

  • apiVersion :: Int

    Desired API version. See currentAPIVersion for the latest version installed on your system. The C API (and this library) allow you to choose any version earlier than currentAPIVersion to get the client behavior of that version of the FoundationDB client library.

  • clusterFile :: Maybe FilePath

    Path to your fdb.cluster file. If Nothing, uses default location.

  • networkOptions :: [NetworkOption]

    Additional network options. Each will be set in order.

  • databaseOptions :: [DatabaseOption]

    Additional database options. Each will be set in order.

defaultOptions :: FoundationDBOptions Source #

Uses the current API version, the default cluster file location, and no additional options.

data Database Source #

Instances

Instances details
Eq Database Source # 
Instance details

Defined in FoundationDB.Internal.Database

Show Database Source # 
Instance details

Defined in FoundationDB.Internal.Database

apiVersionInUse :: Database -> Int Source #

Returns the API version that was specified in the apiVersion field when the FDB client was initialized.

Transactions

Errors

Helpers for ghci

startFoundationDB :: FoundationDBOptions -> IO Database Source #

Starts up FoundationDB. You must call stopFoundationDB before your program terminates. It's recommended that you use withFoundationDB instead, since it handles cleanup. This function is only intended to be used in GHCi. Can only be called once per process! Throws an Error if any part of setting up the connection FoundationDB fails.

stopFoundationDB :: IO () Source #

Stops FoundationDB. For use with startFoundationDB.