aws-0.16: Amazon Web Services (AWS) for Haskell

Copyright | Soostone Inc
License | BSD3
Maintainer | Ozgun Ataman <ozgun.ataman@soostone.com>
Stability | experimental
Safe Haskell | None
Language | Haskell2010

Aws.DynamoDb.Commands.Query

Description

Implementation of Amazon DynamoDb Query command.

See: `http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html`

Synopsis

- data Query = Query {
  - qTableName :: Text
  - qKeyConditions :: Slice
  - qFilter :: Conditions
  - qStartKey :: Maybe [Attribute]
  - qLimit :: Maybe Int
  - qForwardScan :: Bool
  - qSelect :: QuerySelect
  - qRetCons :: ReturnConsumption
  - qIndex :: Maybe Text
  - qConsistent :: Bool
  }
- data Slice = Slice {
  - sliceHash :: Attribute
  - sliceCond :: Maybe Condition
  }
- query :: Text -> Slice -> Query
- data QueryResponse = QueryResponse {
  - qrItems :: Vector Item
  - qrLastKey :: Maybe [Attribute]
  - qrCount :: Int
  - qrScanned :: Int
  - qrConsumed :: Maybe ConsumedCapacity
  }

# Documentation

data Query #

A Query command that uses primary keys for an expedient scan.

Constructors

Query |
Fields qTableName :: Text Required. qKeyConditions :: Slice Required. Hash or hash-range main condition. qFilter :: Conditions Whether to filter results before returning to client qStartKey :: Maybe [Attribute] Exclusive start key to resume a previous query. qLimit :: Maybe Int Whether to limit result set size qForwardScan :: Bool Set to False for descending results qSelect :: QuerySelect What to return from `Query` qRetCons :: ReturnConsumption qIndex :: Maybe Text Whether to use a secondary/global index qConsistent :: Bool

Instances

Eq Query # |
Methods (==) :: Query -> Query -> Bool # (/=) :: Query -> Query -> Bool #
Ord Query # |
Methods compare :: Query -> Query -> Ordering # (<) :: Query -> Query -> Bool # (<=) :: Query -> Query -> Bool # (>) :: Query -> Query -> Bool # (>=) :: Query -> Query -> Bool # max :: Query -> Query -> Query # min :: Query -> Query -> Query #
Read Query # |
Methods readsPrec :: Int -> ReadS Query # readList :: ReadS [Query] # readPrec :: ReadPrec Query # readListPrec :: ReadPrec [Query] #
Show Query # |
Methods showsPrec :: Int -> Query -> ShowS # show :: Query -> String # showList :: [Query] -> ShowS #
ToJSON Query # |
Methods toJSON :: Query -> Value # toEncoding :: Query -> Encoding # toJSONList :: [Query] -> Value # toEncodingList :: [Query] -> Encoding #
SignQuery Query # |
Associated Types type ServiceConfiguration Query :: * -> * # Methods signQuery :: Query -> ServiceConfiguration Query queryType -> SignatureData -> SignedQuery #
IteratedTransaction Query QueryResponse # |
Methods nextIteratedRequest :: Query -> QueryResponse -> Maybe Query #
Transaction Query QueryResponse # |
type ServiceConfiguration Query # |
type ServiceConfiguration Query = DdbConfiguration

data Slice #

`Slice` is the primary constraint in a `Query` command, per AWS requirements.

All `Query` commands must specify a hash attribute via `DEq` and optionally provide a secondary range attribute.

Constructors

Slice |
Fields sliceHash :: Attribute Hash value of the primary key or index being used sliceCond :: Maybe Condition An optional condition specified on the range component, if present, of the primary key or index being used.

Instances

Eq Slice # |
Methods (==) :: Slice -> Slice -> Bool # (/=) :: Slice -> Slice -> Bool #
Ord Slice # |
Methods compare :: Slice -> Slice -> Ordering # (<) :: Slice -> Slice -> Bool # (<=) :: Slice -> Slice -> Bool # (>) :: Slice -> Slice -> Bool # (>=) :: Slice -> Slice -> Bool # max :: Slice -> Slice -> Slice # min :: Slice -> Slice -> Slice #
Read Slice # |
Methods readsPrec :: Int -> ReadS Slice # readList :: ReadS [Slice] # readPrec :: ReadPrec Slice # readListPrec :: ReadPrec [Slice] #
Show Slice # |
Methods showsPrec :: Int -> Slice -> ShowS # show :: Slice -> String # showList :: [Slice] -> ShowS #

query #

Arguments

:: Text | Table name
-> Slice | Primary key slice for query
-> Query |

Construct a minimal `Query` request.

data QueryResponse #

Response to a `Query` query.

Constructors

QueryResponse |
Fields qrItems :: Vector Item qrLastKey :: Maybe [Attribute] qrCount :: Int qrScanned :: Int qrConsumed :: Maybe ConsumedCapacity

Instances

Eq QueryResponse # |
Methods (==) :: QueryResponse -> QueryResponse -> Bool # (/=) :: QueryResponse -> QueryResponse -> Bool #
Ord QueryResponse # |
Methods compare :: QueryResponse -> QueryResponse -> Ordering # (<) :: QueryResponse -> QueryResponse -> Bool # (<=) :: QueryResponse -> QueryResponse -> Bool # (>) :: QueryResponse -> QueryResponse -> Bool # (>=) :: QueryResponse -> QueryResponse -> Bool # max :: QueryResponse -> QueryResponse -> QueryResponse # min :: QueryResponse -> QueryResponse -> QueryResponse #
Read QueryResponse # |
Methods readsPrec :: Int -> ReadS QueryResponse # readList :: ReadS [QueryResponse] # readPrec :: ReadPrec QueryResponse # readListPrec :: ReadPrec [QueryResponse] #
Show QueryResponse # |
Methods showsPrec :: Int -> QueryResponse -> ShowS # show :: QueryResponse -> String # showList :: [QueryResponse] -> ShowS #
FromJSON QueryResponse # |
Methods parseJSON :: Value -> Parser QueryResponse # parseJSONList :: Value -> Parser [QueryResponse] #
AsMemoryResponse QueryResponse # |
Associated Types type MemoryResponse QueryResponse :: * # Methods loadToMemory :: QueryResponse -> ResourceT IO (MemoryResponse QueryResponse) #
IteratedTransaction Query QueryResponse # |
Methods nextIteratedRequest :: Query -> QueryResponse -> Maybe Query #
Transaction Query QueryResponse # |
ListResponse QueryResponse Item # |
Methods listResponse :: QueryResponse -> [Item] #
ResponseConsumer r QueryResponse # |
Associated Types type ResponseMetadata QueryResponse :: * # Methods responseConsumer :: Request -> r -> IORef (ResponseMetadata QueryResponse) -> HTTPResponseConsumer QueryResponse #
type MemoryResponse QueryResponse # |
type MemoryResponse QueryResponse = QueryResponse
type ResponseMetadata QueryResponse # |
type ResponseMetadata QueryResponse = DdbResponse