Documentation ¶
Index ¶
- func AllowLargeResults(shouldAllow bool, tempTableName string, flattenResults bool) func(*Client) error
- type Client
- func (c *Client) AsyncQuery(pageSize int, dataset, project, queryStr string, dataChan chan Data)
- func (c *Client) Count(dataset, project, datasetTable string) int64
- func (c *Client) InsertNewTable(projectID, datasetID, tableName string, fields map[string]string) error
- func (c *Client) InsertNewTableIfDoesNotExist(projectID, datasetID, tableID string, fields map[string]string) error
- func (c *Client) InsertRow(projectID, datasetID, tableID string, rowData map[string]interface{}) error
- func (c *Client) InsertRows(projectID, datasetID, tableID string, rows []map[string]interface{}) error
- func (c *Client) PatchTableSchema(projectID, datasetID, tableID string, fields map[string]string) error
- func (c *Client) Query(dataset, project, queryStr string) ([][]interface{}, []string, error)
- func (c *Client) SyncQuery(dataset, project, queryStr string, maxResults int64) ([][]interface{}, error)
- type Data
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowLargeResults ¶
func AllowLargeResults(shouldAllow bool, tempTableName string, flattenResults bool) func(*Client) error
AllowLargeResults is a configuration function that can be used to enable the AllowLargeResults setting of a bigquery request, as well as a temp table name to use to build the result data
An example use is:
client.New(pemPath, serviceAccountEmailAddress, serviceUserAccountClientID, clientSecret, client.AllowLargeResults(true, "tempTableName"))
Types ¶
type Client ¶
type Client struct { PrintDebug bool RequestTimeout int64 // how long (in milliseconds) to try to create requests for large data (not a query timeout); defaults to 60000 // contains filtered or unexported fields }
Client a big query client instance
func (*Client) AsyncQuery ¶
AsyncQuery loads the data by paging through the query results and sends back payloads over the dataChan - dataChan sends a payload containing Data objects made up of the headers, rows and an error attribute
func (*Client) InsertNewTable ¶
func (c *Client) InsertNewTable(projectID, datasetID, tableName string, fields map[string]string) error
InsertNewTable creates a new empty table for the given project and dataset with the field name/types defined in the fields map
func (*Client) InsertNewTableIfDoesNotExist ¶
func (*Client) InsertRow ¶
func (c *Client) InsertRow(projectID, datasetID, tableID string, rowData map[string]interface{}) error
InsertRow inserts a new row into the desired project, dataset and table or returns an error
func (*Client) InsertRows ¶
func (*Client) PatchTableSchema ¶
func (c *Client) PatchTableSchema(projectID, datasetID, tableID string, fields map[string]string) error
PatchTableSchema sends a patch request to bigquery to modify the table with only the fields provided