Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Official Go client library for Rockset

License

NotificationsYou must be signed in to change notification settings

rockset/rockset-go-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCIDocumentationLicenseGitHub issuesReleaseCoverage Status

Official Go client library for Rockset

Installation

Install the Rockset Go client from Github:

go get github.com/rockset/rockset-go-client

or install it from a source code checkout:

cd $GOPATH/src/github.commkdir rocksetcd rocksetgit clone git@github.com:rockset/rockset-go-client.gitgo install rockset-go-client/rockclient.go

Usage

You can see a fewexamples in the godocof how to create a collection, how to put documents in a collection and how to use SQL to query your collections.

client, err := rockset.NewClient()if err != nil {    log.Fatal(err)}ctx := context.TODO()q := `SELECT * FROM "_events" LIMIT 1`res, _, err := client.Query(ctx, q)if err != nil {    log.Fatal(err)}fmt.Printf("%+v\n", res)

Updating the OpenAPI specification

If the OpenAPI specification has changed, you need to regenerate the OpenAPI client

# bump the minor versionvi version.go # generate a new client./generate.sh# record new VCR cassettesVCR_MODE=record go test ./...

Testing

There are a number of testable examples which require an API key, i.e. set theROCKSET_APIKEY andROCKSET_APISERVERenvironment variables.

To run tests:

go test -v -timeout 30m ./...

To generate the fakes used for testing:

go generate ./...

Go VCR

Most tests useGo VCR, and they will use a cassette (recorded response) by default,so if you want to re-record a cassette, set the environment variableVCR_MODE torecord.

The VCR tracks ignore the patch version of the client version, so when the OpenAPI spec is updated you have tore-record the VCR cassettes.

If you don't havegit lfs set up, install before committing new recordings:

brew install git-lfsgit lfs installgit lfs track "*.cassette.gz"

Code Coverage

go test ./... -coverprofile cover.outgo tool cover -func=cover.outgo tool cover -html=cover.out -o coverage.html

Support

Feel free to log issues against this client through GitHub.

License

The Rockset Go Client is licensed under theApache 2.0 License

Cutting a New Release

  • Update the version inversion.go
  • Rungenerate.sh
    • If you run into issues with this script, try runninggit submodule update --init
  • Rungo mod tidy
  • Re-record VCR cassettesrm -rf testdata/cassettes/ && VCR_MODE=record go test -v -timeout 30m ./...
    • If you have not already, make sure to set upgit lfs before committing:brew install git-lfs && git lfs install && git lfs track "*.cassette.gz"
  • Push and merge branch
  • Rungit tag v{version_number} on master
  • Rungit push origin v{version_number}

About

Official Go client library for Rockset

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp