{-# OPTIONS_GHC -fno-warn-missing-signatures #-}

-- | NOTE: This file is generated from <https://github.com/apple/foundationdb/blob/master/fdbclient/vexillographer/fdb.options fdb.options>
-- by the generate-options executable in this project.
-- All documentation on the individual options in this namespace comes
-- from FoundationDB's documentation in @fdb.options@.
module FoundationDB.Options.DatabaseOption where

import Data.ByteString.Char8 (ByteString)

data DatabaseOption
  = DatabaseOptionString Int String
  | DatabaseOptionInt Int Int
  | DatabaseOptionBytes Int ByteString
  | DatabaseOptionFlag Int
  deriving (Int -> DatabaseOption -> ShowS
[DatabaseOption] -> ShowS
DatabaseOption -> String
(Int -> DatabaseOption -> ShowS)
-> (DatabaseOption -> String)
-> ([DatabaseOption] -> ShowS)
-> Show DatabaseOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatabaseOption] -> ShowS
$cshowList :: [DatabaseOption] -> ShowS
show :: DatabaseOption -> String
$cshow :: DatabaseOption -> String
showsPrec :: Int -> DatabaseOption -> ShowS
$cshowsPrec :: Int -> DatabaseOption -> ShowS
Show, ReadPrec [DatabaseOption]
ReadPrec DatabaseOption
Int -> ReadS DatabaseOption
ReadS [DatabaseOption]
(Int -> ReadS DatabaseOption)
-> ReadS [DatabaseOption]
-> ReadPrec DatabaseOption
-> ReadPrec [DatabaseOption]
-> Read DatabaseOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatabaseOption]
$creadListPrec :: ReadPrec [DatabaseOption]
readPrec :: ReadPrec DatabaseOption
$creadPrec :: ReadPrec DatabaseOption
readList :: ReadS [DatabaseOption]
$creadList :: ReadS [DatabaseOption]
readsPrec :: Int -> ReadS DatabaseOption
$creadsPrec :: Int -> ReadS DatabaseOption
Read, DatabaseOption -> DatabaseOption -> Bool
(DatabaseOption -> DatabaseOption -> Bool)
-> (DatabaseOption -> DatabaseOption -> Bool) -> Eq DatabaseOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatabaseOption -> DatabaseOption -> Bool
$c/= :: DatabaseOption -> DatabaseOption -> Bool
== :: DatabaseOption -> DatabaseOption -> Bool
$c== :: DatabaseOption -> DatabaseOption -> Bool
Eq, Eq DatabaseOption
Eq DatabaseOption
-> (DatabaseOption -> DatabaseOption -> Ordering)
-> (DatabaseOption -> DatabaseOption -> Bool)
-> (DatabaseOption -> DatabaseOption -> Bool)
-> (DatabaseOption -> DatabaseOption -> Bool)
-> (DatabaseOption -> DatabaseOption -> Bool)
-> (DatabaseOption -> DatabaseOption -> DatabaseOption)
-> (DatabaseOption -> DatabaseOption -> DatabaseOption)
-> Ord DatabaseOption
DatabaseOption -> DatabaseOption -> Bool
DatabaseOption -> DatabaseOption -> Ordering
DatabaseOption -> DatabaseOption -> DatabaseOption
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DatabaseOption -> DatabaseOption -> DatabaseOption
$cmin :: DatabaseOption -> DatabaseOption -> DatabaseOption
max :: DatabaseOption -> DatabaseOption -> DatabaseOption
$cmax :: DatabaseOption -> DatabaseOption -> DatabaseOption
>= :: DatabaseOption -> DatabaseOption -> Bool
$c>= :: DatabaseOption -> DatabaseOption -> Bool
> :: DatabaseOption -> DatabaseOption -> Bool
$c> :: DatabaseOption -> DatabaseOption -> Bool
<= :: DatabaseOption -> DatabaseOption -> Bool
$c<= :: DatabaseOption -> DatabaseOption -> Bool
< :: DatabaseOption -> DatabaseOption -> Bool
$c< :: DatabaseOption -> DatabaseOption -> Bool
compare :: DatabaseOption -> DatabaseOption -> Ordering
$ccompare :: DatabaseOption -> DatabaseOption -> Ordering
$cp1Ord :: Eq DatabaseOption
Ord)

-- | Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000.
locationCacheSize :: Int -> DatabaseOption
locationCacheSize Int
i = Int -> Int -> DatabaseOption
DatabaseOptionInt (Int
10) Int
i

-- | Set the maximum number of watches allowed to be outstanding on a database connection. Increasing this number could result in increased resource usage. Reducing this number will not cancel any outstanding watches. Defaults to 10000 and cannot be larger than 1000000.
maxWatches :: Int -> DatabaseOption
maxWatches Int
i = Int -> Int -> DatabaseOption
DatabaseOptionInt (Int
20) Int
i

-- | Specify the machine ID that was passed to fdbserver processes running on the same machine as this client, for better location-aware load balancing.
machineId :: String -> DatabaseOption
machineId String
str = Int -> String -> DatabaseOption
DatabaseOptionString (Int
21) String
str

-- | Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.
datacenterId :: String -> DatabaseOption
datacenterId String
str = Int -> String -> DatabaseOption
DatabaseOptionString (Int
22) String
str

-- | Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.
snapshotRywEnable :: DatabaseOption
snapshotRywEnable = Int -> DatabaseOption
DatabaseOptionFlag (Int
26)

-- | Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.
snapshotRywDisable :: DatabaseOption
snapshotRywDisable = Int -> DatabaseOption
DatabaseOptionFlag (Int
27)

-- | Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option. This sets the ``transaction_logging_max_field_length`` option of each transaction created by this database. See the transaction option description for more information.
transactionLoggingMaxFieldLength :: Int -> DatabaseOption
transactionLoggingMaxFieldLength Int
i = Int -> Int -> DatabaseOption
DatabaseOptionInt (Int
405) Int
i

-- | Set a timeout in milliseconds which, when elapsed, will cause each transaction automatically to be cancelled. This sets the ``timeout`` option of each transaction created by this database. See the transaction option description for more information. Using this option requires that the API version is 610 or higher.
transactionTimeout :: Int -> DatabaseOption
transactionTimeout Int
i = Int -> Int -> DatabaseOption
DatabaseOptionInt (Int
500) Int
i

-- | Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. This sets the ``retry_limit`` option of each transaction created by this database. See the transaction option description for more information.
transactionRetryLimit :: Int -> DatabaseOption
transactionRetryLimit Int
i = Int -> Int -> DatabaseOption
DatabaseOptionInt (Int
501) Int
i

-- | Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. This sets the ``max_retry_delay`` option of each transaction created by this database. See the transaction option description for more information.
transactionMaxRetryDelay :: Int -> DatabaseOption
transactionMaxRetryDelay Int
i = Int -> Int -> DatabaseOption
DatabaseOptionInt (Int
502) Int
i

-- | Set the maximum transaction size in bytes. This sets the ``size_limit`` option on each transaction created by this database. See the transaction option description for more information.
transactionSizeLimit :: Int -> DatabaseOption
transactionSizeLimit Int
i = Int -> Int -> DatabaseOption
DatabaseOptionInt (Int
503) Int
i

-- | The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.
transactionCausalReadRisky :: DatabaseOption
transactionCausalReadRisky = Int -> DatabaseOption
DatabaseOptionFlag (Int
504)

-- | Deprecated. Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect.
transactionIncludePortInAddress :: DatabaseOption
transactionIncludePortInAddress = Int -> DatabaseOption
DatabaseOptionFlag (Int
505)

-- | Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets the ``bypass_unreadable`` option of each transaction created by this database. See the transaction option description for more information.
transactionBypassUnreadable :: DatabaseOption
transactionBypassUnreadable = Int -> DatabaseOption
DatabaseOptionFlag (Int
700)

-- | Use configuration database.
useConfigDatabase :: DatabaseOption
useConfigDatabase = Int -> DatabaseOption
DatabaseOptionFlag (Int
800)

-- | An integer between 0 and 100 (default is 0) expressing the probability that a client will verify it can't read stale data whenever it detects a recovery.
testCausalReadRisky :: DatabaseOption
testCausalReadRisky = Int -> DatabaseOption
DatabaseOptionFlag (Int
900)