{-# LANGUAGE OverloadedStrings #-}
module Database.InfluxDB.Internal.Text
  ( escapeCommas
  , escapeEqualSigns
  , escapeSpaces
  , escapeDoubleQuotes
  , escapeSingleQuotes
  , escapeBackslashes
  ) where
import Data.Text (Text)
import qualified Data.Text as T

escapeCommas
  , escapeEqualSigns
  , escapeSpaces
  , escapeDoubleQuotes
  , escapeSingleQuotes
  , escapeBackslashes :: Text -> Text
escapeCommas :: Text -> Text
escapeCommas = HasCallStack => Text -> Text -> Text -> Text
Text -> Text -> Text -> Text
T.replace Text
"," Text
"\\,"
escapeEqualSigns :: Text -> Text
escapeEqualSigns = HasCallStack => Text -> Text -> Text -> Text
Text -> Text -> Text -> Text
T.replace Text
"=" Text
"\\="
escapeSpaces :: Text -> Text
escapeSpaces = HasCallStack => Text -> Text -> Text -> Text
Text -> Text -> Text -> Text
T.replace Text
" " Text
"\\ "
escapeDoubleQuotes :: Text -> Text
escapeDoubleQuotes = HasCallStack => Text -> Text -> Text -> Text
Text -> Text -> Text -> Text
T.replace Text
"\"" Text
"\\\""
escapeSingleQuotes :: Text -> Text
escapeSingleQuotes = HasCallStack => Text -> Text -> Text -> Text
Text -> Text -> Text -> Text
T.replace Text
"'" Text
"\\'"
escapeBackslashes :: Text -> Text
escapeBackslashes = HasCallStack => Text -> Text -> Text -> Text
Text -> Text -> Text -> Text
T.replace Text
"\\" Text
"\\\\"