module Hasura.Backends.MSSQL.Execute.QueryTags
  ( withQueryTags,
    withQueryTagsPrinter,
  )
where

import Database.ODBC.SQLServer qualified as ODBC
import Hasura.Backends.MSSQL.ToQuery as TQ
import Hasura.Prelude
import Hasura.QueryTags (QueryTagsComment (_unQueryTagsComment))

withQueryTags :: ODBC.Query -> QueryTagsComment -> ODBC.Query
withQueryTags :: Query -> QueryTagsComment -> Query
withQueryTags Query
query QueryTagsComment
queryTags = Query
query Query -> Query -> Query
forall a. Semigroup a => a -> a -> a
<> Text -> Query
ODBC.rawUnescapedText (QueryTagsComment -> Text
_unQueryTagsComment QueryTagsComment
queryTags)

withQueryTagsPrinter :: TQ.Printer -> QueryTagsComment -> TQ.Printer
withQueryTagsPrinter :: Printer -> QueryTagsComment -> Printer
withQueryTagsPrinter Printer
printer QueryTagsComment
queryTags = Printer
printer Printer -> Printer -> Printer
TQ.<+> Text -> Printer
TQ.fromRawUnescapedText (QueryTagsComment -> Text
_unQueryTagsComment QueryTagsComment
queryTags)