module Hasql.Transaction.Private.SQL whereimport ByteString.TreeBuilder qualified as Dimport Hasql.Transaction.Configimport Hasql.Transaction.Private.PreludebeginTransaction :: IsolationLevel -> Mode -> ByteStringbeginTransaction isolation mode = D.toByteString builder where builder = "BEGIN " <> isolationBuilder <> " " <> modeBuilder where isolationBuilder = case isolation of ReadCommitted -> "ISOLATION LEVEL READ COMMITTED" RepeatableRead -> "ISOLATION LEVEL REPEATABLE READ" Serializable -> "ISOLATION LEVEL SERIALIZABLE" modeBuilder = case mode of Write -> "READ WRITE" Read -> "READ ONLY"