Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions bigquery/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ To start working with this package, create a client:

# Querying

To query existing tables, create a Query and call its Read method:
To query existing tables, create a Query and call its Read method, which starts the
query and waits for it to complete:

q := client.Query(`
SELECT year, SUM(number) as num
FROM ` + "`bigquery-public-data.usa_names.usa_1910_2013`" + `
WHERE name = "William"
FROM bigquery-public-data.usa_names.usa_1910_2013
WHERE name = @name
GROUP BY year
ORDER BY year
`)
q.Parameters = []bigquery.QueryParameter{
{Name: "name", Value: "William"},
}
it, err := q.Read(ctx)
if err != nil {
// TODO: Handle error.
Expand Down