factual-api-0.1.2: A driver for the Factual API

Safe HaskellSafe-Infered

Data.Factual.ReadQuery

Contents

Description

This module exports the types used to create read queries.

Synopsis

ReadQuery type

data ReadQuery Source

The ReadQuery type is used to construct read queries. A table should be specified, but the rest of the query options are essentially optional (you opt out using Nothing or an empty List for the value). The select is a list of field names to include in the results. The limit and offset are used to request a specific range of rows and includeCount will include the count of returned rows if it is set to True.

Constructors

ReadQuery 

Search type

data Search Source

This type is used to construct an ANDed or ORed search in a read query.

Constructors

AndSearch [String] 
OrSearch [String] 

Instances

Filter type

type Field = StringSource

A Field is a String representation of the field name.

data Filter Source

The Filter type is used to represent various filters in a read query.

Constructors

EqualNum Field Double

A numeric field has to match a number exactly.

EqualStr Field String

A string field has to match a string exactly.

NotEqualNum Field Double

A numeric field must equal a specific number.

NotEqualStr Field String

A string field must equal a specific string.

InNumList Field [Double]

A numeric field must be equal to any of the numbers in a list.

InStrList Field [String]

A string field must be equal to any of the strings in a list.

NotInNumList Field [Double]

A numeric field must not be equal to any of the numbers in a list.

NotInStrList Field [String]

A string field must not be equal to any of the strings in a list.

BeginsWith Field String

A string field must begin with a specific string.

NotBeginsWith Field String

A string field must not begin with a specific string.

BeginsWithAny Field [String]

A string field must begin with any of the strings in a list.

NotBeginsWithAny Field [String]

A string field must not begin with any of the strings in a list.

IsBlank Field

A field must be blank.

IsNotBlank Field

A field must not be blank.

And [Filter]

Form an AND condition with the filters in the list.

Or [Filter]

Form an OR condition with the filters in the list.

Instances

Geo type

type Lat = DoubleSource

A Lat is the latitude represented as a Double.

type Long = DoubleSource

A Long is the longitude represented as a Double.

type Radius = DoubleSource

A Radius is the radius of the circle as a Double in meters.

data Geo Source

The Geo type is used to limit the search to specific geograph location. Currently, only circles are supported. Supply a latitude, longitude and radius in meters for the circle.

Constructors

Circle Lat Long Radius 

Instances