示例#1
0
文件: main.go 项目: nildev/account
func printTable(client *bigquery.Client, t *bigquery.Table) {
	it, err := client.Read(context.Background(), t)
	if err != nil {
		log.Fatalf("Reading: %v", err)
	}

	id := t.FullyQualifiedName()
	fmt.Printf("%s\n%s\n", id, strings.Repeat("-", len(id)))
	printValues(it)
}
示例#2
0
文件: main.go 项目: nildev/account
func printQueryResults(client *bigquery.Client, queryJobID string) {
	job, err := client.JobFromID(context.Background(), queryJobID)
	if err != nil {
		log.Fatalf("Loading job: %v", err)
	}

	it, err := client.Read(context.Background(), job)
	if err != nil {
		log.Fatalf("Reading: %v", err)
	}

	// TODO: print schema.
	printValues(it)
}