2023-01-19 14:25:52 +03:00
|
|
|
-- | This module contains the default types and functions that model Native
|
|
|
|
-- Queries.
|
|
|
|
module Hasura.NativeQuery.IR
|
|
|
|
( NativeQueryImpl (..),
|
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
import Hasura.NativeQuery.Metadata
|
|
|
|
import Hasura.Prelude
|
2023-01-30 19:04:56 +03:00
|
|
|
import Hasura.RQL.Types.Backend
|
2023-01-19 14:25:52 +03:00
|
|
|
import Hasura.RQL.Types.Column (ColumnValue)
|
|
|
|
|
|
|
|
-- | The default implementation of an invocation of a native query.
|
|
|
|
data NativeQueryImpl b field = NativeQueryImpl
|
|
|
|
{ -- | The defined name of the native query.
|
2023-02-08 18:46:09 +03:00
|
|
|
nqRootFieldName :: NativeQueryName,
|
2023-01-27 17:36:35 +03:00
|
|
|
-- | The raw sql to use in the query
|
2023-02-01 11:44:50 +03:00
|
|
|
nqInterpolatedQuery :: InterpolatedQuery field,
|
2023-01-30 19:04:56 +03:00
|
|
|
-- | The arguments passed to the native query, if any.
|
|
|
|
nqArgs :: HashMap NativeQueryArgumentName (ColumnValue b)
|
2023-01-19 14:25:52 +03:00
|
|
|
}
|
2023-01-30 19:04:56 +03:00
|
|
|
deriving (Functor, Foldable, Traversable)
|
|
|
|
|
2023-02-01 11:44:50 +03:00
|
|
|
deriving instance (Backend b, Eq field) => Eq (NativeQueryImpl b field)
|
2023-01-30 19:04:56 +03:00
|
|
|
|
2023-02-01 11:44:50 +03:00
|
|
|
deriving instance (Backend b, Show field) => Show (NativeQueryImpl b field)
|