{-# LANGUAGE UndecidableInstances #-}
module Hasura.Backends.DataConnector.Adapter.Types.Mutations
( BackendInsert (..),
DataConnectorUpdateVariant (..),
UpdateOperator (..),
)
where
import Hasura.Backends.DataConnector.API qualified as API
import Hasura.Prelude
import Hasura.RQL.IR.Update.Batch (UpdateBatch)
import Hasura.RQL.Types.Backend (Backend)
import Hasura.RQL.Types.BackendType (BackendType (..))
data BackendInsert v = BackendInsert
deriving stock ((forall a b. (a -> b) -> BackendInsert a -> BackendInsert b)
-> (forall a b. a -> BackendInsert b -> BackendInsert a)
-> Functor BackendInsert
forall a b. a -> BackendInsert b -> BackendInsert a
forall a b. (a -> b) -> BackendInsert a -> BackendInsert b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> BackendInsert a -> BackendInsert b
fmap :: forall a b. (a -> b) -> BackendInsert a -> BackendInsert b
$c<$ :: forall a b. a -> BackendInsert b -> BackendInsert a
<$ :: forall a b. a -> BackendInsert b -> BackendInsert a
Functor, (forall m. Monoid m => BackendInsert m -> m)
-> (forall m a. Monoid m => (a -> m) -> BackendInsert a -> m)
-> (forall m a. Monoid m => (a -> m) -> BackendInsert a -> m)
-> (forall a b. (a -> b -> b) -> b -> BackendInsert a -> b)
-> (forall a b. (a -> b -> b) -> b -> BackendInsert a -> b)
-> (forall b a. (b -> a -> b) -> b -> BackendInsert a -> b)
-> (forall b a. (b -> a -> b) -> b -> BackendInsert a -> b)
-> (forall a. (a -> a -> a) -> BackendInsert a -> a)
-> (forall a. (a -> a -> a) -> BackendInsert a -> a)
-> (forall a. BackendInsert a -> [a])
-> (forall a. BackendInsert a -> Bool)
-> (forall a. BackendInsert a -> Int)
-> (forall a. Eq a => a -> BackendInsert a -> Bool)
-> (forall a. Ord a => BackendInsert a -> a)
-> (forall a. Ord a => BackendInsert a -> a)
-> (forall a. Num a => BackendInsert a -> a)
-> (forall a. Num a => BackendInsert a -> a)
-> Foldable BackendInsert
forall a. Eq a => a -> BackendInsert a -> Bool
forall a. Num a => BackendInsert a -> a
forall a. Ord a => BackendInsert a -> a
forall m. Monoid m => BackendInsert m -> m
forall a. BackendInsert a -> Bool
forall a. BackendInsert a -> Int
forall a. BackendInsert a -> [a]
forall a. (a -> a -> a) -> BackendInsert a -> a
forall m a. Monoid m => (a -> m) -> BackendInsert a -> m
forall b a. (b -> a -> b) -> b -> BackendInsert a -> b
forall a b. (a -> b -> b) -> b -> BackendInsert a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => BackendInsert m -> m
fold :: forall m. Monoid m => BackendInsert m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> BackendInsert a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> BackendInsert a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> BackendInsert a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> BackendInsert a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> BackendInsert a -> b
foldr :: forall a b. (a -> b -> b) -> b -> BackendInsert a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> BackendInsert a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> BackendInsert a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> BackendInsert a -> b
foldl :: forall b a. (b -> a -> b) -> b -> BackendInsert a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> BackendInsert a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> BackendInsert a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> BackendInsert a -> a
foldr1 :: forall a. (a -> a -> a) -> BackendInsert a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> BackendInsert a -> a
foldl1 :: forall a. (a -> a -> a) -> BackendInsert a -> a
$ctoList :: forall a. BackendInsert a -> [a]
toList :: forall a. BackendInsert a -> [a]
$cnull :: forall a. BackendInsert a -> Bool
null :: forall a. BackendInsert a -> Bool
$clength :: forall a. BackendInsert a -> Int
length :: forall a. BackendInsert a -> Int
$celem :: forall a. Eq a => a -> BackendInsert a -> Bool
elem :: forall a. Eq a => a -> BackendInsert a -> Bool
$cmaximum :: forall a. Ord a => BackendInsert a -> a
maximum :: forall a. Ord a => BackendInsert a -> a
$cminimum :: forall a. Ord a => BackendInsert a -> a
minimum :: forall a. Ord a => BackendInsert a -> a
$csum :: forall a. Num a => BackendInsert a -> a
sum :: forall a. Num a => BackendInsert a -> a
$cproduct :: forall a. Num a => BackendInsert a -> a
product :: forall a. Num a => BackendInsert a -> a
Foldable, Functor BackendInsert
Foldable BackendInsert
Functor BackendInsert
-> Foldable BackendInsert
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BackendInsert a -> f (BackendInsert b))
-> (forall (f :: * -> *) a.
Applicative f =>
BackendInsert (f a) -> f (BackendInsert a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BackendInsert a -> m (BackendInsert b))
-> (forall (m :: * -> *) a.
Monad m =>
BackendInsert (m a) -> m (BackendInsert a))
-> Traversable BackendInsert
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
BackendInsert (m a) -> m (BackendInsert a)
forall (f :: * -> *) a.
Applicative f =>
BackendInsert (f a) -> f (BackendInsert a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BackendInsert a -> m (BackendInsert b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BackendInsert a -> f (BackendInsert b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BackendInsert a -> f (BackendInsert b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BackendInsert a -> f (BackendInsert b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
BackendInsert (f a) -> f (BackendInsert a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
BackendInsert (f a) -> f (BackendInsert a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BackendInsert a -> m (BackendInsert b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BackendInsert a -> m (BackendInsert b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
BackendInsert (m a) -> m (BackendInsert a)
sequence :: forall (m :: * -> *) a.
Monad m =>
BackendInsert (m a) -> m (BackendInsert a)
Traversable)
data DataConnectorUpdateVariant v
= SingleBatch (UpdateBatch 'DataConnector UpdateOperator v)
| MultipleBatches [UpdateBatch 'DataConnector UpdateOperator v]
deriving stock instance (Backend 'DataConnector) => Functor DataConnectorUpdateVariant
deriving stock instance (Backend 'DataConnector) => Foldable DataConnectorUpdateVariant
deriving stock instance (Backend 'DataConnector) => Traversable DataConnectorUpdateVariant
data UpdateOperator v
= UpdateSet v
| UpdateCustomOperator API.UpdateColumnOperatorName v
deriving stock ((forall a b. (a -> b) -> UpdateOperator a -> UpdateOperator b)
-> (forall a b. a -> UpdateOperator b -> UpdateOperator a)
-> Functor UpdateOperator
forall a b. a -> UpdateOperator b -> UpdateOperator a
forall a b. (a -> b) -> UpdateOperator a -> UpdateOperator b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> UpdateOperator a -> UpdateOperator b
fmap :: forall a b. (a -> b) -> UpdateOperator a -> UpdateOperator b
$c<$ :: forall a b. a -> UpdateOperator b -> UpdateOperator a
<$ :: forall a b. a -> UpdateOperator b -> UpdateOperator a
Functor, (forall m. Monoid m => UpdateOperator m -> m)
-> (forall m a. Monoid m => (a -> m) -> UpdateOperator a -> m)
-> (forall m a. Monoid m => (a -> m) -> UpdateOperator a -> m)
-> (forall a b. (a -> b -> b) -> b -> UpdateOperator a -> b)
-> (forall a b. (a -> b -> b) -> b -> UpdateOperator a -> b)
-> (forall b a. (b -> a -> b) -> b -> UpdateOperator a -> b)
-> (forall b a. (b -> a -> b) -> b -> UpdateOperator a -> b)
-> (forall a. (a -> a -> a) -> UpdateOperator a -> a)
-> (forall a. (a -> a -> a) -> UpdateOperator a -> a)
-> (forall a. UpdateOperator a -> [a])
-> (forall a. UpdateOperator a -> Bool)
-> (forall a. UpdateOperator a -> Int)
-> (forall a. Eq a => a -> UpdateOperator a -> Bool)
-> (forall a. Ord a => UpdateOperator a -> a)
-> (forall a. Ord a => UpdateOperator a -> a)
-> (forall a. Num a => UpdateOperator a -> a)
-> (forall a. Num a => UpdateOperator a -> a)
-> Foldable UpdateOperator
forall a. Eq a => a -> UpdateOperator a -> Bool
forall a. Num a => UpdateOperator a -> a
forall a. Ord a => UpdateOperator a -> a
forall m. Monoid m => UpdateOperator m -> m
forall a. UpdateOperator a -> Bool
forall a. UpdateOperator a -> Int
forall a. UpdateOperator a -> [a]
forall a. (a -> a -> a) -> UpdateOperator a -> a
forall m a. Monoid m => (a -> m) -> UpdateOperator a -> m
forall b a. (b -> a -> b) -> b -> UpdateOperator a -> b
forall a b. (a -> b -> b) -> b -> UpdateOperator a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => UpdateOperator m -> m
fold :: forall m. Monoid m => UpdateOperator m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> UpdateOperator a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> UpdateOperator a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> UpdateOperator a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> UpdateOperator a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> UpdateOperator a -> b
foldr :: forall a b. (a -> b -> b) -> b -> UpdateOperator a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> UpdateOperator a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> UpdateOperator a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> UpdateOperator a -> b
foldl :: forall b a. (b -> a -> b) -> b -> UpdateOperator a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> UpdateOperator a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> UpdateOperator a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> UpdateOperator a -> a
foldr1 :: forall a. (a -> a -> a) -> UpdateOperator a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> UpdateOperator a -> a
foldl1 :: forall a. (a -> a -> a) -> UpdateOperator a -> a
$ctoList :: forall a. UpdateOperator a -> [a]
toList :: forall a. UpdateOperator a -> [a]
$cnull :: forall a. UpdateOperator a -> Bool
null :: forall a. UpdateOperator a -> Bool
$clength :: forall a. UpdateOperator a -> Int
length :: forall a. UpdateOperator a -> Int
$celem :: forall a. Eq a => a -> UpdateOperator a -> Bool
elem :: forall a. Eq a => a -> UpdateOperator a -> Bool
$cmaximum :: forall a. Ord a => UpdateOperator a -> a
maximum :: forall a. Ord a => UpdateOperator a -> a
$cminimum :: forall a. Ord a => UpdateOperator a -> a
minimum :: forall a. Ord a => UpdateOperator a -> a
$csum :: forall a. Num a => UpdateOperator a -> a
sum :: forall a. Num a => UpdateOperator a -> a
$cproduct :: forall a. Num a => UpdateOperator a -> a
product :: forall a. Num a => UpdateOperator a -> a
Foldable, Functor UpdateOperator
Foldable UpdateOperator
Functor UpdateOperator
-> Foldable UpdateOperator
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> UpdateOperator a -> f (UpdateOperator b))
-> (forall (f :: * -> *) a.
Applicative f =>
UpdateOperator (f a) -> f (UpdateOperator a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> UpdateOperator a -> m (UpdateOperator b))
-> (forall (m :: * -> *) a.
Monad m =>
UpdateOperator (m a) -> m (UpdateOperator a))
-> Traversable UpdateOperator
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
UpdateOperator (m a) -> m (UpdateOperator a)
forall (f :: * -> *) a.
Applicative f =>
UpdateOperator (f a) -> f (UpdateOperator a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> UpdateOperator a -> m (UpdateOperator b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> UpdateOperator a -> f (UpdateOperator b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> UpdateOperator a -> f (UpdateOperator b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> UpdateOperator a -> f (UpdateOperator b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
UpdateOperator (f a) -> f (UpdateOperator a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
UpdateOperator (f a) -> f (UpdateOperator a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> UpdateOperator a -> m (UpdateOperator b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> UpdateOperator a -> m (UpdateOperator b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
UpdateOperator (m a) -> m (UpdateOperator a)
sequence :: forall (m :: * -> *) a.
Monad m =>
UpdateOperator (m a) -> m (UpdateOperator a)
Traversable)