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

..03-May-2022-

benchmarks/H11-Oct-2019-10675

datatransfer/apiv1/H11-Oct-2019-2,4971,856

storage/apiv1beta1/H11-Oct-2019-986671

.repo-metadata.jsonH A D11-Oct-2019389 1312

CHANGES.mdH A D11-Oct-2019606 2313

README.mdH A D11-Oct-20191.2 KiB4743

bigquery.goH A D11-Oct-20194.9 KiB163107

bigquery.replayH A D11-Oct-2019917.8 KiB28,10028,100

copy.goH A D11-Oct-20193.2 KiB10865

copy_test.goH A D11-Oct-20194 KiB164144

dataset.goH A D11-Oct-201921.4 KiB722547

dataset_test.goH A D11-Oct-201913.9 KiB476428

doc.goH A D11-Oct-20199.5 KiB3091

error.goH A D11-Oct-20192.4 KiB8450

error_test.goH A D11-Oct-20192.6 KiB11086

examples_test.goH A D11-Oct-201920.2 KiB830609

external.goH A D11-Oct-201913.1 KiB408241

external_test.goH A D11-Oct-20193.7 KiB147124

extract.goH A D11-Oct-20193.5 KiB12076

extract_test.goH A D11-Oct-20193.3 KiB134111

file.goH A D11-Oct-20194.7 KiB13873

file_test.goH A D11-Oct-20192.5 KiB9978

gcs.goH A D11-Oct-20192.7 KiB7632

go.modH A D11-Oct-2019489 1714

go.sumH A D11-Oct-201916.3 KiB170169

go_mod_tidy_hack.goH A D11-Oct-2019919 232

inserter.goH A D11-Oct-20197.2 KiB241156

inserter_test.goH A D11-Oct-20195.4 KiB211185

integration_test.goH A D11-Oct-201964.3 KiB2,4242,118

iterator.goH A D11-Oct-20196.7 KiB223139

iterator_test.goH A D11-Oct-20198.9 KiB363325

job.goH A D11-Oct-201925.4 KiB835556

job_test.goH A D11-Oct-20192.4 KiB9676

load.goH A D11-Oct-20195 KiB15491

load_test.goH A D11-Oct-20197.8 KiB299272

model.goH A D11-Oct-20198.3 KiB270164

model_test.goH A D11-Oct-20193.2 KiB123103

nulls.goH A D11-Oct-20198.2 KiB349252

nulls_test.goH A D11-Oct-20192.4 KiB7654

oc_test.goH A D11-Oct-20191 KiB3918

params.goH A D11-Oct-201910.6 KiB371277

params_test.goH A D11-Oct-20199.5 KiB376332

query.goH A D11-Oct-201911.6 KiB329195

query_test.goH A D11-Oct-201911.1 KiB409373

random.goH A D11-Oct-20191.5 KiB5726

read_test.goH A D11-Oct-20196.5 KiB234194

routine.goH A D11-Oct-20199.4 KiB347263

routine_test.goH A D11-Oct-20194 KiB152131

schema.goH A D11-Oct-201915.6 KiB537356

schema_test.goH A D11-Oct-201925.7 KiB1,1351,060

standardsql.goH A D11-Oct-20194.4 KiB178131

standardsql_test.goH A D11-Oct-20192.9 KiB132112

table.goH A D11-Oct-201920.5 KiB654430

table_test.goH A D11-Oct-201910.8 KiB391362

value.goH A D11-Oct-201924 KiB895710

value_test.goH A D11-Oct-201933.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```