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

..31-Mar-2020-

benchmarks/H31-Mar-2020-10675

connection/apiv1beta1/H31-Mar-2020-630415

datatransfer/apiv1/H31-Mar-2020-3,2202,320

reservation/apiv1beta1/H31-Mar-2020-1,385946

storage/H31-Mar-2020-2,3341,474

CHANGES.mdH A D31-Mar-20201.5 KiB5834

README.mdH A D31-Mar-20201.2 KiB4743

bigquery.goH A D31-Mar-20204.8 KiB15799

bigquery.replayH A D31-Mar-2020928.5 KiB28,37628,376

copy.goH A D31-Mar-20203.2 KiB10865

copy_test.goH A D31-Mar-20204 KiB164144

dataset.goH A D31-Mar-202021.7 KiB731553

dataset_test.goH A D31-Mar-202014 KiB477429

doc.goH A D31-Mar-20209.5 KiB3091

error.goH A D31-Mar-20202.7 KiB10770

error_test.goH A D31-Mar-20203 KiB11591

examples_test.goH A D31-Mar-202020.2 KiB830609

external.goH A D31-Mar-202013.1 KiB408241

external_test.goH A D31-Mar-20203.7 KiB147124

extract.goH A D31-Mar-20203.5 KiB12076

extract_test.goH A D31-Mar-20203.3 KiB136113

file.goH A D31-Mar-20204.7 KiB13873

file_test.goH A D31-Mar-20202.5 KiB9978

gcs.goH A D31-Mar-20203 KiB8234

go.modH A D31-Mar-2020601 1916

go.sumH A D31-Mar-202037.9 KiB392391

go_mod_tidy_hack.goH A D31-Mar-2020919 232

inserter.goH A D31-Mar-20207.5 KiB249159

inserter_test.goH A D31-Mar-20205.6 KiB213187

integration_test.goH A D31-Mar-202070.6 KiB2,6722,340

iterator.goH A D31-Mar-20206.7 KiB223139

iterator_test.goH A D31-Mar-20208.9 KiB363325

job.goH A D31-Mar-202028.2 KiB918605

job_test.goH A D31-Mar-20202.4 KiB9676

load.goH A D31-Mar-20205.2 KiB15994

load_test.goH A D31-Mar-20209 KiB350323

model.goH A D31-Mar-20208.3 KiB270164

model_test.goH A D31-Mar-20203.2 KiB123103

nulls.goH A D31-Mar-20208.2 KiB349252

nulls_test.goH A D31-Mar-20202.4 KiB7654

oc_test.goH A D31-Mar-20201 KiB3918

params.goH A D31-Mar-202010.6 KiB371277

params_test.goH A D31-Mar-20209.5 KiB376332

query.goH A D31-Mar-202011.8 KiB335198

query_test.goH A D31-Mar-202012.2 KiB455419

random.goH A D31-Mar-20201.5 KiB5726

read_test.goH A D31-Mar-20206.5 KiB234194

routine.goH A D31-Mar-20209.6 KiB355271

routine_test.goH A D31-Mar-20204 KiB154133

schema.goH A D31-Mar-202015.6 KiB537356

schema_test.goH A D31-Mar-202025.7 KiB1,1351,060

standardsql.goH A D31-Mar-20204.4 KiB178131

standardsql_test.goH A D31-Mar-20202.9 KiB132112

table.goH A D31-Mar-202022.4 KiB727482

table_test.goH A D31-Mar-202011.3 KiB421391

value.goH A D31-Mar-202024.9 KiB922710

value_test.goH A D31-Mar-202033.2 KiB1,3021,184

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```