Skip to content

sk88ks/bq-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bq-client

Build Status Coverage Status

Bq-client is a client for Google bigquery with golang. This works on progress.

Current API Documents:

  • bq-client: GoDoc

Installation

go get github.com/sk88ks/bq-client

Quick start

To create a new client,

import(
  "fmt"
  bqc "github.com/sk88ks/bq-client"
)

type Response struct {
  ....
}

const (
 keyPath = "pathToKeyPemfile"
 accountEmail = "your account email"
 gcpProject = "your gcp projact ID"
 bqDataset = "your data set name"
)

func main() {
	key, err := bqc.GetPrivateKeyByPEM(keyPath)
	if err != nil {
		return err
	}
	bqClient := bqc.New(accountEmail, key, "")
	bqClient.Dataset(gcpProject, bqDataset)
	
	var res []Response
	queryString := "SELECT * FROM test.test_table WHERE num > 0"
	err = bqClient.Query(query).Execute(&res)
	fmt.Println(res)
	
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published