Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data DynamoException = DynamoException Text
- class DynamoEncodable a where
- class (ScalarAuto v, DynamoEncodable a) => DynamoScalar v a | a -> v where
- data ScalarValue v where
- ScS :: !Text -> ScalarValue S
- ScN :: !Scientific -> ScalarValue N
- ScB :: !ByteString -> ScalarValue B
- class (Eq a, Hashable a) => IsText a where
- class IsNumber a
- data RangeOper a where
- 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
Exceptions
data DynamoException Source #
Exceptions thrown by some dynamodb-simple actions.
Marshalling
class DynamoEncodable a where Source #
Typeclass showing that this datatype can be saved to DynamoDB.
dEncode :: a -> Maybe AttributeValue Source #
Encode data. Return Nothing
if attribute should be omitted.
dEncode :: (Show a, Read a) => a -> Maybe AttributeValue Source #
Encode data. Return Nothing
if attribute should be omitted.
dDecode :: Maybe AttributeValue -> Maybe a Source #
Decode data. Return Nothing
on parsing error, gets
Nothing
on input if the attribute was missing in the database.
dDecode :: (Show a, Read a) => Maybe AttributeValue -> Maybe a Source #
Decode data. Return Nothing
on parsing error, gets
Nothing
on input if the attribute was missing in the database.
dIsMissing :: a -> Bool Source #
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.
DynamoEncodable Bool Source # | |
DynamoEncodable Double Source # | |
DynamoEncodable Int Source # | |
DynamoEncodable Integer Source # | |
DynamoEncodable Word Source # | |
DynamoEncodable ByteString Source # | |
DynamoEncodable Scientific Source # | |
DynamoEncodable Text Source # | |
DynamoEncodable Value Source # | Partial encoding/decoding Aeson values. Empty strings get converted to NULL. |
DynamoEncodable a => DynamoEncodable [a] Source # | DynamoDB cannot represent empty items; [ |
DynamoEncodable a => DynamoEncodable (Maybe a) Source # |
|
(Ord a, DynamoScalar v a) => DynamoEncodable (Set a) Source # | |
(IsText t, DynamoEncodable a) => DynamoEncodable (HashMap t a) Source # | |
DynamoEncodable a => DynamoEncodable (Tagged * v a) Source # | |
class (ScalarAuto v, DynamoEncodable a) => DynamoScalar v a | a -> v where Source #
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
scalarEncode :: a -> ScalarValue v Source #
Scalars must have total encoding function
scalarEncode :: (Show a, Read a) => a -> ScalarValue S Source #
Scalars must have total encoding function
scalarDecode :: ScalarValue v -> Maybe a Source #
scalarDecode :: (Show a, Read a) => ScalarValue S -> Maybe a Source #
DynamoScalar S Text Source # | |
DynamoScalar N Double Source # | Don't use Double as a part of primary key in a table. It is included here for convenience to be used as a range key in indexes. |
DynamoScalar N Int Source # | |
DynamoScalar N Integer Source # | |
DynamoScalar N Word Source # | |
DynamoScalar N Scientific Source # | Double as a primary key isn't generally a good thing as equality on double is sometimes a little dodgy. Use scientific instead. |
DynamoScalar B ByteString Source # | |
DynamoScalar v a => DynamoScalar v (Tagged * x a) Source # | Helper for tagged values |
data ScalarValue v where Source #
Datatype for encoding scalar values
ScS :: !Text -> ScalarValue S | |
ScN :: !Scientific -> ScalarValue N | |
ScB :: !ByteString -> ScalarValue B |
class (Eq a, Hashable a) => IsText a where Source #
Class to limit certain operations to text-like only in queries.
Members of this class can be keys to HashMap
.
Class to limit +=. and -=. for updates.
Query datatype
data RangeOper a where Source #
Operation on range key for query
.
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 |
Utility functions
dType :: forall a v. DynamoScalar v a => Proxy a -> ScalarAttributeType Source #
dScalarEncode :: DynamoScalar v a => a -> AttributeValue Source #