-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Typesafe library for working with DynamoDB database -- -- Framework for accessing DynamoDB database. The majority of AWS API is -- available to the user in a convenient, simple and typesafe manner. @package dynamodb-simple @version 0.2.0.0 module Database.DynamoDB.Types -- | Exceptions thrown by some dynamodb-simple actions. data DynamoException DynamoException :: Text -> DynamoException -- | Typeclass showing that this datatype can be saved to DynamoDB. class DynamoEncodable a where dEncode val = Just $ attributeValue & avS .~ (Just $ pack $ show val) dDecode (Just attr) = attr ^. avS >>= (readMaybe . unpack) dDecode Nothing = Nothing dIsMissing _ = False -- | Encode data. Return Nothing if attribute should be omitted. dEncode :: DynamoEncodable a => a -> Maybe AttributeValue -- | Encode data. Return Nothing if attribute should be omitted. dEncode :: (DynamoEncodable a, Show a, Read a) => a -> Maybe AttributeValue -- | Decode data. Return Nothing on parsing error, gets -- Nothing on input if the attribute was missing in the database. dDecode :: DynamoEncodable a => Maybe AttributeValue -> Maybe a -- | Decode data. Return Nothing on parsing error, gets -- Nothing on input if the attribute was missing in the database. dDecode :: (DynamoEncodable a, Show a, Read a) => Maybe AttributeValue -> Maybe a -- | Aid for searching for empty list and hashmap; these can be represented -- both by empty list and by missing value, if this returns true, enhance -- search. dIsMissing :: DynamoEncodable a => a -> Bool -- | Typeclass signifying that this is a scalar attribute and can be used -- as a hash/sort key. -- --
--   instance DynamoScalar Network.AWS.DynamoDB.Types.S T.Text where
--      scalarEncode = ScS
--      scalarDecode (ScS txt) = Just txt
--   
class (ScalarAuto v, DynamoEncodable a) => DynamoScalar (v :: ScalarAttributeType) a | a -> v where scalarEncode = ScS . pack . show scalarDecode (ScS txt) = readMaybe (unpack txt) -- | Scalars must have total encoding function scalarEncode :: DynamoScalar v a => a -> ScalarValue v -- | Scalars must have total encoding function scalarEncode :: (DynamoScalar v a, Show a, Read a) => a -> ScalarValue S scalarDecode :: DynamoScalar v a => ScalarValue v -> Maybe a scalarDecode :: (DynamoScalar v a, Show a, Read a) => ScalarValue S -> Maybe a -- | Datatype for encoding scalar values data ScalarValue (v :: ScalarAttributeType) [ScS] :: !Text -> ScalarValue S [ScN] :: !Scientific -> ScalarValue N [ScB] :: !ByteString -> ScalarValue B -- | Class to limit certain operations to text-like only in queries. -- Members of this class can be keys to HashMap. class (Eq a, Hashable a) => IsText a toText :: IsText a => a -> Text fromText :: IsText a => Text -> a -- | Class to limit +=. and -=. for updates. class IsNumber a -- | Operation on range key for query. data RangeOper a [RangeEquals] :: a -> RangeOper a [RangeLessThan] :: a -> RangeOper a [RangeLessThanE] :: a -> RangeOper a [RangeGreaterThan] :: a -> RangeOper a [RangeGreaterThanE] :: a -> RangeOper a [RangeBetween] :: a -> a -> RangeOper a [RangeBeginsWith] :: (IsText a) => a -> RangeOper a dType :: forall a v. DynamoScalar v a => Proxy a -> ScalarAttributeType dScalarEncode :: DynamoScalar v a => a -> AttributeValue instance GHC.Show.Show Database.DynamoDB.Types.DynamoException instance GHC.Exception.Exception Database.DynamoDB.Types.DynamoException instance Database.DynamoDB.Types.ScalarAuto 'Network.AWS.DynamoDB.Types.Sum.S instance Database.DynamoDB.Types.ScalarAuto 'Network.AWS.DynamoDB.Types.Sum.N instance Database.DynamoDB.Types.ScalarAuto 'Network.AWS.DynamoDB.Types.Sum.B instance Database.DynamoDB.Types.DynamoScalar 'Network.AWS.DynamoDB.Types.Sum.N GHC.Integer.Type.Integer instance Database.DynamoDB.Types.DynamoScalar 'Network.AWS.DynamoDB.Types.Sum.N GHC.Types.Int instance Database.DynamoDB.Types.DynamoScalar 'Network.AWS.DynamoDB.Types.Sum.N GHC.Types.Word instance Database.DynamoDB.Types.DynamoScalar v a => Database.DynamoDB.Types.DynamoScalar v (Data.Tagged.Tagged x a) instance Database.DynamoDB.Types.DynamoScalar 'Network.AWS.DynamoDB.Types.Sum.N Data.Scientific.Scientific instance Database.DynamoDB.Types.DynamoScalar 'Network.AWS.DynamoDB.Types.Sum.N GHC.Types.Double instance Database.DynamoDB.Types.DynamoScalar 'Network.AWS.DynamoDB.Types.Sum.S Data.Text.Internal.Text instance Database.DynamoDB.Types.DynamoScalar 'Network.AWS.DynamoDB.Types.Sum.B Data.ByteString.Internal.ByteString instance Database.DynamoDB.Types.DynamoEncodable Data.Scientific.Scientific instance Database.DynamoDB.Types.DynamoEncodable GHC.Integer.Type.Integer instance Database.DynamoDB.Types.DynamoEncodable GHC.Types.Int instance Database.DynamoDB.Types.DynamoEncodable GHC.Types.Word instance Database.DynamoDB.Types.DynamoEncodable GHC.Types.Double instance Database.DynamoDB.Types.DynamoEncodable GHC.Types.Bool instance Database.DynamoDB.Types.DynamoEncodable Data.Text.Internal.Text instance Database.DynamoDB.Types.DynamoEncodable Data.ByteString.Internal.ByteString instance Database.DynamoDB.Types.DynamoEncodable a => Database.DynamoDB.Types.DynamoEncodable (GHC.Base.Maybe a) instance (GHC.Classes.Ord a, Database.DynamoDB.Types.DynamoScalar v a) => Database.DynamoDB.Types.DynamoEncodable (Data.Set.Base.Set a) instance (Database.DynamoDB.Types.IsText t, Database.DynamoDB.Types.DynamoEncodable a) => Database.DynamoDB.Types.DynamoEncodable (Data.HashMap.Base.HashMap t a) instance Database.DynamoDB.Types.DynamoEncodable a => Database.DynamoDB.Types.DynamoEncodable [a] instance Database.DynamoDB.Types.DynamoEncodable a => Database.DynamoDB.Types.DynamoEncodable (Data.Tagged.Tagged v a) instance Database.DynamoDB.Types.DynamoEncodable Data.Aeson.Types.Internal.Value instance Database.DynamoDB.Types.IsNumber GHC.Types.Int instance Database.DynamoDB.Types.IsNumber GHC.Types.Double instance Database.DynamoDB.Types.IsNumber GHC.Integer.Type.Integer instance Database.DynamoDB.Types.IsNumber a => Database.DynamoDB.Types.IsNumber (Data.Tagged.Tagged t a) instance Database.DynamoDB.Types.IsText Data.Text.Internal.Text instance (Data.Hashable.Class.Hashable (Data.Tagged.Tagged t a), Database.DynamoDB.Types.IsText a) => Database.DynamoDB.Types.IsText (Data.Tagged.Tagged t a) -- | Module for creating update actions -- -- Example as used in nested structure for scan: -- --
--   updateItemByKey_ (Proxy :: Proxy Test, ("hashkey", "sortkey"))
--                    ((iInt' +=. 5) <> (iText' =. "updated") <> (iMText' =. Nothing))
--   
-- -- The unique Action can be added together using the -- <> operator. You are not supposed to operate on the same -- attribute simultaneously using multiple actions. module Database.DynamoDB.Update -- | An action for updateItemByKey functions. data Action t -- | Add a number to a saved attribute. (+=.) :: (InCollection col tbl FullPath, DynamoScalar v typ, IsNumber typ) => Column typ TypColumn col -> typ -> Action tbl infix 4 +=. -- | Subtract a number from a saved attribute. (-=.) :: (InCollection col tbl FullPath, DynamoScalar v typ, IsNumber typ) => Column typ TypColumn col -> typ -> Action tbl infix 4 -=. -- | Set an attribute to a new value. (=.) :: (InCollection col tbl FullPath, DynamoEncodable typ) => Column typ TypColumn col -> typ -> Action tbl infix 4 =. -- | Set on a Maybe type, if it was not set before. setIfNothing :: (InCollection col tbl FullPath, DynamoEncodable typ) => Column (Maybe typ) TypColumn col -> typ -> Action tbl -- | Append a new value to an end of a list. append :: (InCollection col tbl FullPath, DynamoEncodable typ) => Column [typ] TypColumn col -> [typ] -> Action tbl -- | Insert a value to a beginning of a list prepend :: (InCollection col tbl FullPath, DynamoEncodable typ) => Column [typ] TypColumn col -> [typ] -> Action tbl -- | Add a new value to a set. add :: (InCollection col tbl FullPath, DynamoEncodable (Set typ)) => Column (Set typ) TypColumn col -> Set typ -> Action tbl -- | Remove a value from a set. delete :: (InCollection col tbl FullPath, DynamoEncodable (Set typ)) => Column (Set typ) TypColumn col -> Set typ -> Action tbl -- | Delete n-th list of an item. delListItem :: InCollection col tbl FullPath => Column [typ] TypColumn col -> Int -> Action tbl -- | Delete a key from a map. delHashKey :: (InCollection col tbl FullPath, IsText key) => Column (HashMap key typ) TypColumn col -> key -> Action tbl -- | Generate an action expression and associated structures from a list of -- actions dumpActions :: Action t -> Maybe (Text, HashMap Text Text, HashMap Text AttributeValue) instance GHC.Base.Monoid (Database.DynamoDB.Update.Action t) instance Data.Semigroup.Semigroup (Database.DynamoDB.Update.Action t) instance Database.DynamoDB.Update.ActionClass Database.DynamoDB.Update.Set instance Database.DynamoDB.Update.ActionClass Database.DynamoDB.Update.Add instance Database.DynamoDB.Update.ActionClass Database.DynamoDB.Update.Delete instance Database.DynamoDB.Update.ActionClass Database.DynamoDB.Update.Remove -- | Module for creating filter conditions -- -- Example as used in nested structure for scan: -- --
--   scanCond (hashitem' <!:> "a" <.> author' <.> name' ==. "x") 20
--   
module Database.DynamoDB.Filter -- | Filter condition. Use with scan, query, update and delete methods. -- -- Filtering on primary key is not allowed. data FilterCondition t -- | Negate condition Not :: (FilterCondition t) -> FilterCondition t -- | AND for combining conditions. (&&.) :: FilterCondition t -> FilterCondition t -> FilterCondition t infixr 3 &&. -- | OR for combining conditions (||.) :: FilterCondition t -> FilterCondition t -> FilterCondition t infixr 3 ||. -- | Tests for equality. Automatically adjusts query to account for missing -- attributes. -- -- Note: checks against empty values esentially translate to -- attrMissing. (==.) :: (InCollection col tbl FullPath, DynamoEncodable typ) => Column typ ctyp col -> typ -> FilterCondition tbl infix 4 ==. -- |
--   a /= b === Not (a == b)
--   
(/=.) :: (InCollection col tbl FullPath, DynamoEncodable typ) => Column typ ctyp col -> typ -> FilterCondition tbl infix 4 /=. (>=.) :: (InCollection col tbl FullPath, DynamoEncodable typ, Ord typ) => Column typ ctyp col -> typ -> FilterCondition tbl infix 4 >=. (>.) :: (InCollection col tbl FullPath, DynamoEncodable typ, Ord typ) => Column typ ctyp col -> typ -> FilterCondition tbl infix 4 >. (<=.) :: (InCollection col tbl FullPath, DynamoEncodable typ, Ord typ) => Column typ ctyp col -> typ -> FilterCondition tbl infix 4 <=. (<.) :: (InCollection col tbl FullPath, DynamoEncodable typ, Ord typ) => Column typ ctyp col -> typ -> FilterCondition tbl infix 4 <. -- | Check existence of attribute. attrExists :: (InCollection col tbl FullPath) => Column typ TypColumn col -> FilterCondition tbl -- | Checks non-existence of an attribute attrMissing :: (InCollection col tbl FullPath) => Column typ TypColumn col -> FilterCondition tbl -- | Comparison for text columns. beginsWith :: (InCollection col tbl FullPath, IsText typ) => Column typ TypColumn col -> Text -> FilterCondition tbl -- | CONTAINS condition for text-like attributes. contains :: (InCollection col tbl FullPath, IsText typ) => Column typ TypColumn col -> Text -> FilterCondition tbl -- | CONTAINS condition for sets. setContains :: (InCollection col tbl FullPath, DynamoScalar v a) => Column (Set a) TypColumn col -> a -> FilterCondition tbl -- | a IN (b, c, d); the list may contain up to 100 values. valIn :: (InCollection col tbl FullPath, DynamoScalar v typ) => Column typ ctyp col -> [typ] -> FilterCondition tbl -- | Numeric/string range comparison. between :: (Ord typ, InCollection col tbl FullPath, DynamoScalar v typ) => Column typ ctyp col -> (typ, typ) -> FilterCondition tbl -- | Size (i.e. number of bytes) of saved attribute. size :: Column typ TypColumn col -> Column Int TypSize col -- | Template Haskell macros to automatically derive instances, create -- column datatypes and create migrations functions. module Database.DynamoDB.TH -- | Create instances, datatypes for table, fields and instances. -- -- Example of what gets created: -- --
--   data Test { first :: Text, second :: Text, third :: Int }
--   data TestIndex { third :: Int, second :: T.Text}
--   
--   mkTableDefs (tableConfig (''Test, WithRange) [(''TestIndex, NoRange)] [])
--   
--   deriveGenericOnly ''Test
--   instance DynamoCollection Test WithRange IsTable
--   ...
--   instance DynamoTable Test WithRange
--      tableName _ = "Test"
--   
--   deriveGenericOnly ''TestIndex
--   instance DynamoCollection TestIndex NoRange IsIndex
--   ...
--   instance DynamoIndex TestIndex Test NoRange IsIndex
--      indexName _ = "TestIndex"
--   
--   data P_First
--   instance ColumnInfo P_First where
--       columnName _ = "first"
--   instance InCollection P_First Test 'NestedPath -- For every attribute
--   instance InCollection P_Second TestIndex 'FullPath -- For every non-primary attribute
--   first' :: Column Text TypColumn P_First
--   first' = Column
--   
mkTableDefs :: String -> TableConfig -> Q [Dec] -- | Configuration of TH macro for creating table instances data TableConfig TableConfig :: (Name, RangeType, String) -> [(Name, RangeType, String)] -> [(Name, String)] -> (String -> String) -> Bool -> TableConfig -- | Table type, primary key type, table name [tableSetup] :: TableConfig -> (Name, RangeType, String) -- | Global index type, primary key type, index name [globalIndexes] :: TableConfig -> [(Name, RangeType, String)] -- | Local index type, index name [localIndexes] :: TableConfig -> [(Name, String)] -- | Translation of haskell field names to DynamoDB attribute names [translateField] :: TableConfig -> String -> String -- | Builds polymorphic lens for main table and indexes for table fields -- starting with '_' [buildLens] :: TableConfig -> Bool -- | Simple table configuration tableConfig :: (Name, RangeType) -> [(Name, RangeType)] -> [Name] -> TableConfig -- | Translates haskell field names to database attribute names. Strips -- everything up to first '_'. defaultTranslate :: String -> String -- | Derive DynamoEncodable and prepare column instances for nested -- structures. deriveCollection :: Name -> (String -> String) -> Q [Dec] -- | Derive just the DynamoEncodable instance for structures that -- were already derived using mkTableDefs and you want to use them -- as nested structures as well. -- -- Creates: -- --
--   instance DynamoEncodable Type where
--     dEncode val = Just (attributeValue & avM .~ gdEncodeG [fieldnames] val)
--     dDecode (Just attr) = gdDecodeG [fieldnames] (attr ^. avM)
--     dDecode Nothing = Nothing
--   instance InCollection column_type P_Column1 'NestedPath
--   instance InCollection column_type P_Column2 'NestedPath
--   ...
--   
deriveEncodable :: Name -> (String -> String) -> Q [Dec] -- | Data collection type - with hash key or with hash+sort key data RangeType NoRange :: RangeType WithRange :: RangeType -- | Type-safe library for accessing DynamoDB database. module Database.DynamoDB -- | Exceptions thrown by some dynamodb-simple actions. data DynamoException DynamoException :: Text -> DynamoException -- | Parameter for queries involving read consistency settings. data Consistency Eventually :: Consistency Strongly :: Consistency -- | Query direction data Direction Forward :: Direction Backward :: Direction -- | Representation of a column for filter queries -- -- data Column typ (coltype :: ColumnType) col -- | Combine attributes from nested structures. -- --
--   address' <.> street'
--   
(<.>) :: (InCollection col2 (UnMaybe typ) NestedPath) => Column typ TypColumn col1 -> Column typ2 TypColumn col2 -> Column typ2 TypColumn col1 infixl 7 <.> -- | Access an index in a nested list. -- --
--   users' <!> 0 <.> name'
--   
() :: Column [typ] TypColumn col -> Int -> Column typ TypColumn col infixl 8 -- | Access a key in a nested hashmap. -- --
--   phones' <!:> "mobile" <.> number'
--   
() :: IsText key => Column (HashMap key typ) TypColumn col -> key -> Column typ TypColumn col infixl 8 -- | Read item from the database; primary key is either a hash key or -- (hash,range) tuple depending on the table. getItem :: forall m a r range hash rest. (MonadAWS m, DynamoTable a r, HasPrimaryKey a r IsTable, Code a ~ '[hash : (range : rest)]) => Consistency -> (Proxy a, PrimaryKey (Code a) r) -> m (Maybe a) -- | Get batch of items. getItemBatch :: forall m a r range hash rest. (MonadAWS m, DynamoTable a r, HasPrimaryKey a r IsTable, Code a ~ '[hash : (range : rest)]) => Consistency -> [PrimaryKey (Code a) r] -> m [a] -- | Options for a generic query. data QueryOpts a hash range -- | Default settings for query options. queryOpts :: hash -> QueryOpts a hash range qConsistentRead :: forall a_aTMW hash_aTMX range_aTMY. Lens' (QueryOpts a_aTMW hash_aTMX range_aTMY) Consistency qStartKey :: forall a_aTMW hash_aTMX range_aTMY. Lens' (QueryOpts a_aTMW hash_aTMX range_aTMY) (Maybe (hash_aTMX, range_aTMY)) qDirection :: forall a_aTMW hash_aTMX range_aTMY. Lens' (QueryOpts a_aTMW hash_aTMX range_aTMY) Direction qFilterCondition :: forall a_aTMW hash_aTMX range_aTMY a_aU60. Lens (QueryOpts a_aTMW hash_aTMX range_aTMY) (QueryOpts a_aU60 hash_aTMX range_aTMY) (Maybe (FilterCondition a_aTMW)) (Maybe (FilterCondition a_aU60)) qHashKey :: forall a_aTMW hash_aTMX range_aTMY. Lens' (QueryOpts a_aTMW hash_aTMX range_aTMY) hash_aTMX qRangeCondition :: forall a_aTMW hash_aTMX range_aTMY. Lens' (QueryOpts a_aTMW hash_aTMX range_aTMY) (Maybe (RangeOper range_aTMY)) qLimit :: forall a_aTMW hash_aTMX range_aTMY. Lens' (QueryOpts a_aTMW hash_aTMX range_aTMY) (Maybe Natural) -- | Fetch exactly the required count of items even when it means more -- calls to dynamodb. Return last evaluted key if end of data was not -- reached. Use qStartKey to continue reading the query. query :: forall a t v1 v2 m range hash rest. (TableQuery a t, DynamoCollection a WithRange t, MonadAWS m, Code a ~ '[hash : (range : rest)], DynamoScalar v1 hash, DynamoScalar v2 range) => Proxy a -> QueryOpts a hash range -> Int -> m ([a], Maybe (PrimaryKey (Code a) WithRange)) -- | Perform a simple, eventually consistent, query. -- -- Simple to use function to query limited amount of data from database. querySimple :: forall a t v1 v2 m hash range rest. (TableQuery a t, MonadAWS m, Code a ~ '[hash : (range : rest)], DynamoScalar v1 hash, DynamoScalar v2 range) => Proxy a -> hash -> Maybe (RangeOper range) -> Direction -> Int -> m [a] -- | Query with condition queryCond :: forall a t v1 v2 m hash range rest. (TableQuery a t, MonadAWS m, Code a ~ '[hash : (range : rest)], DynamoScalar v1 hash, DynamoScalar v2 range) => Proxy a -> hash -> Maybe (RangeOper range) -> FilterCondition a -> Direction -> Int -> m [a] -- | Generic query function. You can query table or indexes that have a -- range key defined. The filter condition cannot access the hash and -- range keys. querySource :: forall a t m v1 v2 hash range rest. (TableQuery a t, MonadAWS m, Code a ~ '[hash : (range : rest)], DynamoScalar v1 hash, DynamoScalar v2 range) => Proxy a -> QueryOpts a hash range -> Source m a -- | Record for defining scan command. Use lenses to set the content. -- -- sParallel: (Segment number, Total segments) data ScanOpts a r scanOpts :: ScanOpts a r sFilterCondition :: forall a_aU7s r_aU7t. Lens' (ScanOpts a_aU7s r_aU7t) (Maybe (FilterCondition a_aU7s)) sConsistentRead :: forall a_aU7s r_aU7t. Lens' (ScanOpts a_aU7s r_aU7t) Consistency sLimit :: forall a_aU7s r_aU7t. Lens' (ScanOpts a_aU7s r_aU7t) (Maybe Natural) sParallel :: forall a_aU7s r_aU7t. Lens' (ScanOpts a_aU7s r_aU7t) (Maybe (Natural, Natural)) sStartKey :: forall a_aU7s r_aU7t r_aUIr. Lens (ScanOpts a_aU7s r_aU7t) (ScanOpts a_aU7s r_aUIr) (Maybe (PrimaryKey (Code a_aU7s) r_aU7t)) (Maybe (PrimaryKey (Code a_aU7s) r_aUIr)) -- | Function to call bounded scans. Tries to return exactly requested -- number of items. -- -- Use sStartKey to continue the scan. scan :: (MonadAWS m, Code a ~ '[hash : (range : rest)], TableScan a r t, HasPrimaryKey a r t) => Proxy a -> ScanOpts a r -> Int -> m ([a], Maybe (PrimaryKey (Code a) r)) -- | Conduit source for running a scan. scanSource :: (MonadAWS m, TableScan a r t, HasPrimaryKey a r t, Code a ~ '[hash : (range : xss)]) => Proxy a -> ScanOpts a r -> Source m a -- | Scan table using a given filter condition. -- --
--   scanCond (colAddress <!:> "Home" <.> colCity ==. "London") 10
--   
scanCond :: forall a m hash range rest r t. (MonadAWS m, HasPrimaryKey a r t, Code a ~ '[hash : (range : rest)], TableScan a r t) => Proxy a -> FilterCondition a -> Int -> m [a] -- | Write item into the database; overwrite any previously existing item -- with the same primary key. putItem :: (MonadAWS m, DynamoTable a r) => a -> m () -- | Batch write into the database. -- -- The batch is divided to 25-item chunks, each is sent and retried -- separately. If a batch fails on dynamodb exception, it is raised. -- -- Note: On exception, the information about which items were saved is -- unavailable putItemBatch :: forall m a r. (MonadAWS m, DynamoTable a r) => [a] -> m () -- | Write item into the database only if it doesn't already exist. insertItem :: forall a r m. (MonadAWS m, DynamoTable a r) => a -> m () updateItemByKey :: forall a m r hash range rest. (MonadAWS m, HasPrimaryKey a r IsTable, DynamoTable a r, Code a ~ '[hash : (range : rest)]) => (Proxy a, PrimaryKey (Code a) r) -> Action a -> m a -- | Update item in a table -- --
--   updateItem (Proxy :: Proxy Test) (12, "2") [colCount +=. 100]
--   
updateItemByKey_ :: forall a m r hash range rest. (MonadAWS m, HasPrimaryKey a r IsTable, DynamoTable a r, Code a ~ '[hash : (range : rest)]) => (Proxy a, PrimaryKey (Code a) r) -> Action a -> m () -- | Update item in a table while specifying a condition updateItemCond_ :: forall a m r hash range rest. (MonadAWS m, DynamoTable a r, HasPrimaryKey a r IsTable, Code a ~ '[hash : (range : rest)]) => (Proxy a, PrimaryKey (Code a) r) -> Action a -> FilterCondition a -> m () -- | Delete item from the database by specifying the primary key. deleteItemByKey :: forall m a r hash range rest. (MonadAWS m, HasPrimaryKey a r IsTable, DynamoTable a r, Code a ~ '[hash : (range : rest)]) => (Proxy a, PrimaryKey (Code a) r) -> m () -- | Delete item from the database by specifying the primary key and a -- condition. Throws AWS exception if the condition does not succeed. deleteItemCondByKey :: forall m a r hash range rest. (MonadAWS m, HasPrimaryKey a r IsTable, DynamoTable a r, Code a ~ '[hash : (range : rest)]) => (Proxy a, PrimaryKey (Code a) r) -> FilterCondition a -> m () -- | Batch version of deleteItemByKey. -- -- Note: Because the requests are chunked, the information about which -- items were deleted in case of exception is unavailable. deleteItemBatchByKey :: forall m a r range hash rest. (MonadAWS m, HasPrimaryKey a r IsTable, DynamoTable a r, Code a ~ '[hash : (range : rest)]) => Proxy a -> [PrimaryKey (Code a) r] -> m () -- | Delete table from DynamoDB. deleteTable :: (MonadAWS m, DynamoTable a r) => Proxy a -> m () -- | Extract primary key from a record in a form that can be directly used -- by other functions. -- -- You can use this on both main table or on index tables if they contain -- the primary key from the main table. Table key is always projected to -- indexes anyway, so just define it in every index. tableKey :: forall a parent key. ContainsTableKey a parent key => a -> (Proxy parent, key)