2023-01-19 14:25:52 +03:00
|
|
|
-- | This module contains the default types and functions that model Native
|
|
|
|
-- Queries.
|
|
|
|
module Hasura.NativeQuery.IR
|
2023-02-15 19:26:16 +03:00
|
|
|
( NativeQuery (..),
|
2023-01-19 14:25:52 +03:00
|
|
|
)
|
|
|
|
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.
|
2023-02-15 19:26:16 +03:00
|
|
|
data NativeQuery b field = NativeQuery
|
2023-01-19 14:25:52 +03:00
|
|
|
{ -- | The defined name of the native query.
|
2023-02-21 16:45:12 +03:00
|
|
|
nqRootFieldName :: LogicalModelName,
|
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-15 19:26:16 +03:00
|
|
|
deriving instance (Backend b, Eq field) => Eq (NativeQuery b field)
|
2023-01-30 19:04:56 +03:00
|
|
|
|
2023-02-15 19:26:16 +03:00
|
|
|
deriving instance (Backend b, Show field) => Show (NativeQuery b field)
|