aws-0.24.4: 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 Source #

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

Instances details

ToJSON Query Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods toJSON :: Query -> Value Source # toEncoding :: Query -> Encoding Source # toJSONList :: [Query] -> Value Source # toEncodingList :: [Query] -> Encoding Source # omitField :: Query -> Bool Source #
SignQuery Query Source # |

Instance details

Defined in Aws.DynamoDb.Commands.Query

Associated Types

type ServiceConfiguration Query |
Instance details Defined in Aws.DynamoDb.Commands.Query type ServiceConfiguration Query = DdbConfiguration

Methods

signQuery :: Query -> ServiceConfiguration Query queryType -> SignatureData -> SignedQuery Source #

Read Query Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods readsPrec :: Int -> ReadS Query Source # readList :: ReadS [Query] Source # readPrec :: ReadPrec Query Source # readListPrec :: ReadPrec [Query] Source #
Show Query Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods showsPrec :: Int -> Query -> ShowS Source # show :: Query -> String Source # showList :: [Query] -> ShowS Source #
Eq Query Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods (==) :: Query -> Query -> Bool Source # (/=) :: Query -> Query -> Bool Source #
Ord Query Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods compare :: Query -> Query -> Ordering Source # (<) :: Query -> Query -> Bool Source # (<=) :: Query -> Query -> Bool Source # (>) :: Query -> Query -> Bool Source # (>=) :: Query -> Query -> Bool Source # max :: Query -> Query -> Query Source # min :: Query -> Query -> Query Source #
IteratedTransaction Query QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods nextIteratedRequest :: Query -> QueryResponse -> Maybe Query Source #
Transaction Query QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query
type ServiceConfiguration Query Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query type ServiceConfiguration Query = DdbConfiguration

data Slice Source #

`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

Instances details

Read Slice Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods readsPrec :: Int -> ReadS Slice Source # readList :: ReadS [Slice] Source # readPrec :: ReadPrec Slice Source # readListPrec :: ReadPrec [Slice] Source #
Show Slice Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods showsPrec :: Int -> Slice -> ShowS Source # show :: Slice -> String Source # showList :: [Slice] -> ShowS Source #
Eq Slice Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods (==) :: Slice -> Slice -> Bool Source # (/=) :: Slice -> Slice -> Bool Source #
Ord Slice Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods compare :: Slice -> Slice -> Ordering Source # (<) :: Slice -> Slice -> Bool Source # (<=) :: Slice -> Slice -> Bool Source # (>) :: Slice -> Slice -> Bool Source # (>=) :: Slice -> Slice -> Bool Source # max :: Slice -> Slice -> Slice Source # min :: Slice -> Slice -> Slice Source #

query Source #

Arguments

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

Construct a minimal `Query` request.

data QueryResponse Source #

Response to a `Query` query.

Constructors

QueryResponse |

Fields

- qrItems :: Vector Item
- qrLastKey :: Maybe [Attribute]
- qrCount :: Int
- qrScanned :: Int
- qrConsumed :: Maybe ConsumedCapacity

#### Instances

Instances details

FromJSON QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods parseJSON :: Value -> Parser QueryResponse Source # parseJSONList :: Value -> Parser [QueryResponse] Source # omittedField :: Maybe QueryResponse Source #
AsMemoryResponse QueryResponse Source # |

Instance details

Defined in Aws.DynamoDb.Commands.Query

Associated Types

type MemoryResponse QueryResponse |
Instance details Defined in Aws.DynamoDb.Commands.Query type MemoryResponse QueryResponse = QueryResponse

Methods

loadToMemory :: QueryResponse -> ResourceT IO (MemoryResponse QueryResponse) Source #

Read QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods readsPrec :: Int -> ReadS QueryResponse Source # readList :: ReadS [QueryResponse] Source # readPrec :: ReadPrec QueryResponse Source # readListPrec :: ReadPrec [QueryResponse] Source #
Show QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods showsPrec :: Int -> QueryResponse -> ShowS Source # show :: QueryResponse -> String Source # showList :: [QueryResponse] -> ShowS Source #
Eq QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods (==) :: QueryResponse -> QueryResponse -> Bool Source # (/=) :: QueryResponse -> QueryResponse -> Bool Source #
Ord QueryResponse Source # |

Instance details

Defined in Aws.DynamoDb.Commands.Query

Methods

compare :: QueryResponse -> QueryResponse -> Ordering Source #

(<) :: QueryResponse -> QueryResponse -> Bool Source #

(<=) :: QueryResponse -> QueryResponse -> Bool Source #

(>) :: QueryResponse -> QueryResponse -> Bool Source #

(>=) :: QueryResponse -> QueryResponse -> Bool Source #

max :: QueryResponse -> QueryResponse -> QueryResponse Source #

min :: QueryResponse -> QueryResponse -> QueryResponse Source #

IteratedTransaction Query QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods nextIteratedRequest :: Query -> QueryResponse -> Maybe Query Source #
ListResponse QueryResponse Item Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods listResponse :: QueryResponse -> [Item] Source #
ResponseConsumer r QueryResponse Source # |

Instance details

Defined in Aws.DynamoDb.Commands.Query

Associated Types

type ResponseMetadata QueryResponse |
Instance details Defined in Aws.DynamoDb.Commands.Query type ResponseMetadata QueryResponse = DdbResponse

Methods

responseConsumer :: Request -> r -> IORef (ResponseMetadata QueryResponse) -> HTTPResponseConsumer QueryResponse Source #

Transaction Query QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query
type MemoryResponse QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query type MemoryResponse QueryResponse = QueryResponse
type ResponseMetadata QueryResponse Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query type ResponseMetadata QueryResponse = DdbResponse