handa-gdata-0.7.0.2: Library and command-line utility for accessing Google services and APIs.

Safe HaskellNone
LanguageHaskell98

Network.Google.FusionTables

Contents

Description

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.

Synopsis

Types

type TableId = FTString Source

ID for a specific fusion table

One-to-one wrappers around API routines, with parsing of JSON results

createTable :: AccessToken -> String -> [(FTString, CellType)] -> IO TableMetadata Source

Create an (exportable) table with a given name and list of columns.

createColumn :: AccessToken -> TableId -> (FTString, CellType) -> IO ColumnMetadata Source

Create a new column in a given table. Returns the metadata for the new column.

listTables Source

Arguments

:: AccessToken

The OAuth 2.0 access token.

-> IO [TableMetadata] 

listColumns Source

Arguments

:: AccessToken

The OAuth 2.0 access token.

-> TableId

which table

-> IO [ColumnMetadata] 

Higher level interface to common SQL queries

insertRows Source

Arguments

:: 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.

NOTE: this method has a major limitation. SQL queries are encoded into the URL, and it is very easy to exceed the maximum URL length accepted by Google APIs.

bulkImportRows Source

Arguments

:: AccessToken 
-> TableId 
-> [FTString]

Which columns to write.

-> [[FTString]]

Rows

-> IO () 

Implement a larger quantity of rows, but with the caveat that the number and order of columns must exactly match the schema of the fusion table on the server. bulkImportRows will perform a listing of the columns to verify this before uploading.

This function also checks that the server reports receiving the same number of rows as were uploaded.

NOTE: also use this function for LONG rows, even if there is only one. Really, you should almost always use this function rather thna insertRows.

getData Source

Arguments

:: AccessToken 
-> String

Table ID

-> String

The SQL expression following SELECT

-> Maybe String

Optional expression to follow WHERE

-> IO ColData 

data ColData Source

Constructors

ColData 

Fields

colName :: [FTString]
 
values :: [[FTValue]]
 

Instances

data FTValue Source

Constructors

StringValue FTString 
DoubleValue Double 

Instances

tableSelect Source

Arguments

:: AccessToken 
-> String

Table ID

-> String

The SQL expression following SELECT

-> Maybe String

Optional expression to follow WHERE

-> IO ColData 

tableSQLQuery Source

Arguments

:: AccessToken 
-> String

Table ID

-> String

Complete SQL expression.

-> IO ColData 

Run a supported SQL query to retrieve data from a fusion table.