airtable-api 0.1.0.3 → 0.1.0.4
raw patch · 3 files changed
+5/−4 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Airtable.Table: selectMaybe :: (IsRecord r, Show a) => Table a -> r -> Maybe a
+ Airtable.Table: selectMaybe :: (IsRecord r) => Table a -> r -> Maybe a
Files
- airtable-api.cabal +1/−1
- src/Airtable/Query.hs +1/−1
- src/Airtable/Table.hs +3/−2
airtable-api.cabal view
@@ -1,5 +1,5 @@ name: airtable-api-version: 0.1.0.3+version: 0.1.0.4 synopsis: Requesting and introspecting Tables within an Airtable project. -- description: homepage: https://github.com/ooblahman/airtable-api
src/Airtable/Query.hs view
@@ -42,7 +42,7 @@ base_url :: String base_url = "https://api.airtable.com/" --- | Retrieve a table from airtable.com given its name. +-- | Retrieve a table from airtable.com given its name. Handles pagination correctly. getTable :: (FromJSON a) => AirtableOptions -> TableName -> IO (Table a) getTable opts tname = getTableFromUrl net_otps url where
src/Airtable/Table.hs view
@@ -113,7 +113,8 @@ exists :: (IsRecord r) => Table a -> r -> Bool exists tbl rec = Map.member (toRec rec) (tableRecords tbl) --- | Unsafely lookup a record using its RecordID.+-- | Unsafely lookup a record using its RecordID. Will throw a pretty-printed error+-- if record does not exist. select :: (HasCallStack, IsRecord r, Show a) => Table a -> r -> a select tbl rec = tableRecords tbl `lookup` toRec rec where@@ -122,7 +123,7 @@ Nothing -> error $ "lookup failed in map: " <> show k -- | Safely lookup a record using its RecordID.-selectMaybe :: (IsRecord r, Show a) => Table a -> r -> Maybe a+selectMaybe :: (IsRecord r) => Table a -> r -> Maybe a selectMaybe tbl rec = toRec rec `Map.lookup` tableRecords tbl -- | Read all records.