2023-04-27 17:02:55 +03:00
|
|
|
-- | The RQL IR representation of an invocation of a stored procedure.
|
|
|
|
module Hasura.StoredProcedure.IR
|
|
|
|
( StoredProcedure (..),
|
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
import Hasura.LogicalModel.IR
|
|
|
|
import Hasura.Prelude
|
|
|
|
import Hasura.RQL.Types.Backend
|
|
|
|
import Hasura.StoredProcedure.Metadata
|
2023-05-02 16:30:22 +03:00
|
|
|
import Language.GraphQL.Draft.Syntax qualified as G
|
2023-04-27 17:02:55 +03:00
|
|
|
|
|
|
|
-- | The RQL IR representation of an invocation of a stored procedure.
|
|
|
|
data StoredProcedure b field = StoredProcedure
|
2023-05-02 16:30:22 +03:00
|
|
|
{ -- | The SQL name of the stored procedure.
|
|
|
|
spStoredProcedure :: FunctionName b,
|
|
|
|
-- | The graphql name of the stored procedure.
|
|
|
|
spGraphqlName :: G.Name,
|
2023-04-27 17:02:55 +03:00
|
|
|
-- | The arguments passed to the query, if any.
|
2023-05-02 16:30:22 +03:00
|
|
|
spArgs :: HashMap ArgumentName (ScalarType b, field),
|
2023-04-27 17:02:55 +03:00
|
|
|
-- | The return type of the stored procedure
|
|
|
|
spLogicalModel :: LogicalModel b
|
|
|
|
}
|
|
|
|
deriving (Functor, Foldable, Traversable)
|
|
|
|
|
|
|
|
deriving instance (Backend b, Eq field) => Eq (StoredProcedure b field)
|
|
|
|
|
|
|
|
deriving instance (Backend b, Show field) => Show (StoredProcedure b field)
|