Safe Haskell | None |
---|
Functions for accessing the Fusion Tables API, see https://developers.google.com/fusiontables/.
This provides a very limited subset of the complete (v1) API at present.
- type TableId = FTString
- data TableMetadata = TableMetadata {
- tab_name :: FTString
- tab_tableId :: FTString
- tab_columns :: [ColumnMetadata]
- data ColumnMetadata = ColumnMetadata {
- col_columnId :: Int
- col_name :: FTString
- col_type :: FTString
- listTables :: AccessToken -> IO JSValue
- listColumns :: AccessToken -> TableId -> IO JSValue
- parseTables :: JSValue -> Result [TableMetadata]
- parseColumns :: JSValue -> Result [ColumnMetadata]
- insertRows :: AccessToken -> TableId -> [FTString] -> [[FTString]] -> IO ()
Types
data TableMetadata Source
An incomplete representation of https://developers.google.com/fusiontables/docs/v1/reference/table#resource
TableMetadata | |
|
data ColumnMetadata Source
ColumnMetadata | |
|
Raw API routines, returning raw JSON
:: AccessToken | The OAuth 2.0 access token. |
-> IO JSValue |
List all tables belonging to a user. See https://developers.google.com/fusiontables/docs/v1/reference/table/list.
:: AccessToken | The OAuth 2.0 access token. |
-> TableId | which table |
-> IO JSValue |
List the columns within a specific table. See https://developers.google.com/fusiontables/docs/v1/reference/column/list.
Parsing result of raw API routines
parseTables :: JSValue -> Result [TableMetadata]Source
Construct a simple Haskell representation of the result of listTables
.
parseColumns :: JSValue -> Result [ColumnMetadata]Source
Parse the output of listColumns
.
Higher level interface to common SQL queries
:: AccessToken | |
-> TableId | |
-> [FTString] | Which columns to write. |
-> [[FTString]] | Rows |
-> IO () |
Insert one or more rows into a table. Rows are represented as lists of strings. The columns being written are passed in as a separate list. The length of all rows must match eachother and must match the list of column names.