• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..18-Jul-2019-

benchmarks/H18-Jul-2019-10675

datatransfer/apiv1/H18-Jul-2019-2,4771,838

storage/apiv1beta1/H18-Jul-2019-970657

README.mdH A D18-Jul-20191.2 KiB4743

bigquery.goH A D18-Jul-20194.9 KiB163107

bigquery.replayH A D18-Jul-2019888.5 KiB26,49326,493

copy.goH A D18-Jul-20193.2 KiB10865

copy_test.goH A D18-Jul-20194 KiB164144

dataset.goH A D18-Jul-201920.8 KiB709537

dataset_test.goH A D18-Jul-201913.5 KiB457409

doc.goH A D18-Jul-20199.6 KiB3111

error.goH A D18-Jul-20192.4 KiB8450

error_test.goH A D18-Jul-20192.6 KiB11086

examples_test.goH A D18-Jul-201920.2 KiB830609

external.goH A D18-Jul-201912.9 KiB401238

external_test.goH A D18-Jul-20193.7 KiB144121

extract.goH A D18-Jul-20193 KiB11173

extract_test.goH A D18-Jul-20192.8 KiB11794

file.goH A D18-Jul-20194.7 KiB13873

file_test.goH A D18-Jul-20192.5 KiB9978

gcs.goH A D18-Jul-20192.7 KiB7632

inserter.goH A D18-Jul-20197.2 KiB241156

inserter_test.goH A D18-Jul-20195.4 KiB211185

integration_test.goH A D18-Jul-201964 KiB2,4212,116

iterator.goH A D18-Jul-20196.7 KiB223139

iterator_test.goH A D18-Jul-20198.9 KiB363325

job.goH A D18-Jul-201925.4 KiB835556

job_test.goH A D18-Jul-20192.4 KiB9676

load.goH A D18-Jul-20195 KiB15491

load_test.goH A D18-Jul-20197.8 KiB299272

model.goH A D18-Jul-20198 KiB259158

model_test.goH A D18-Jul-20193 KiB121101

nulls.goH A D18-Jul-20198.2 KiB349252

nulls_test.goH A D18-Jul-20192.4 KiB7654

oc_test.goH A D18-Jul-20191 KiB3918

params.goH A D18-Jul-201910.6 KiB371277

params_test.goH A D18-Jul-20199.5 KiB376332

query.goH A D18-Jul-201911.6 KiB329195

query_test.goH A D18-Jul-201911.1 KiB409373

random.goH A D18-Jul-20191.5 KiB5726

read_test.goH A D18-Jul-20196.5 KiB234194

routine.goH A D18-Jul-20199.4 KiB347263

routine_test.goH A D18-Jul-20194 KiB152131

schema.goH A D18-Jul-201915.3 KiB519341

schema_test.goH A D18-Jul-201923.8 KiB1,045970

standardsql.goH A D18-Jul-20194.4 KiB178131

standardsql_test.goH A D18-Jul-20192.9 KiB132112

table.goH A D18-Jul-201920.5 KiB655430

table_test.goH A D18-Jul-201910.8 KiB391362

value.goH A D18-Jul-201923.8 KiB893710

value_test.goH A D18-Jul-201932.4 KiB1,2641,149

README.md

1## BigQuery [![GoDoc](https://godoc.org/cloud.google.com/go/bigquery?status.svg)](https://godoc.org/cloud.google.com/go/bigquery)
2
3- [About BigQuery](https://cloud.google.com/bigquery/)
4- [API documentation](https://cloud.google.com/bigquery/docs)
5- [Go client documentation](https://godoc.org/cloud.google.com/go/bigquery)
6- [Complete sample programs](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/bigquery)
7
8### Example Usage
9
10First create a `bigquery.Client` to use throughout your application:
11[snip]:# (bq-1)
12```go
13c, err := bigquery.NewClient(ctx, "my-project-ID")
14if err != nil {
15	// TODO: Handle error.
16}
17```
18
19Then use that client to interact with the API:
20[snip]:# (bq-2)
21```go
22// Construct a query.
23q := c.Query(`
24    SELECT year, SUM(number)
25    FROM [bigquery-public-data:usa_names.usa_1910_2013]
26    WHERE name = "William"
27    GROUP BY year
28    ORDER BY year
29`)
30// Execute the query.
31it, err := q.Read(ctx)
32if err != nil {
33	// TODO: Handle error.
34}
35// Iterate through the results.
36for {
37	var values []bigquery.Value
38	err := it.Next(&values)
39	if err == iterator.Done {
40		break
41	}
42	if err != nil {
43		// TODO: Handle error.
44	}
45	fmt.Println(values)
46}
47```