airtable-api-0.1.0.4: Requesting and introspecting Tables within an Airtable project.

Safe HaskellNone
LanguageHaskell2010

Airtable.Table

Contents

Synopsis

RecordID

newtype RecordID Source #

Airtable's record ID for use in indexing records

Constructors

RecordID Text 

IsRecord class

class IsRecord a where Source #

A convenience typeclass for selecting records using RecordID-like keys.

Minimal complete definition

toRec

Methods

toRec :: a -> RecordID Source #

Table

data Table a Source #

Airtable's table type

Constructors

Table 

Instances

Eq a => Eq (Table a) Source # 

Methods

(==) :: Table a -> Table a -> Bool #

(/=) :: Table a -> Table a -> Bool #

Read a => Read (Table a) Source # 
Show a => Show (Table a) Source # 

Methods

showsPrec :: Int -> Table a -> ShowS #

show :: Table a -> String #

showList :: [Table a] -> ShowS #

Generic (Table a) Source # 

Associated Types

type Rep (Table a) :: * -> * #

Methods

from :: Table a -> Rep (Table a) x #

to :: Rep (Table a) x -> Table a #

Monoid (Table a) Source # 

Methods

mempty :: Table a #

mappend :: Table a -> Table a -> Table a #

mconcat :: [Table a] -> Table a #

FromJSON a => FromJSON (Table a) Source # 
type Rep (Table a) Source # 
type Rep (Table a) = D1 (MetaData "Table" "Airtable.Table" "airtable-api-0.1.0.4-75ultrLkg1Y2qpEFKMGmmp" False) (C1 (MetaCons "Table" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "tableRecords") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (HashMap RecordID a))) (S1 (MetaSel (Just Symbol "tableOffset") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)))))

type TableName = String Source #

Synonym used in querying tables from the API.

Table methods

toList :: Table a -> [(RecordID, a)] Source #

Convert a Table to a list of key-record pairs.

exists :: IsRecord r => Table a -> r -> Bool Source #

Check if a record exists at the given key in a table.

select :: (HasCallStack, IsRecord r, Show a) => Table a -> r -> a Source #

Unsafely lookup a record using its RecordID. Will throw a pretty-printed error if record does not exist.

selectMaybe :: IsRecord r => Table a -> r -> Maybe a Source #

Safely lookup a record using its RecordID.

selectAll :: Table a -> [a] Source #

Read all records.

selectAllKeys :: Table a -> [RecordID] Source #

Read all RecordID's.

selectWhere :: Table a -> (RecordID -> a -> Bool) -> [a] Source #

Select all records satisfying a condition.

selectKeyWhere :: Table a -> (RecordID -> a -> Bool) -> [RecordID] Source #

Select all RecordID's satisfying a condition.

deleteWhere :: Table a -> (RecordID -> a -> Bool) -> Table a Source #

Delete all Records satisfying a condition.