spatk

package module
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 0 Imported by: 0

README

spatk

Spanner ToolKit

sidx

Spanner InDeX helper generator.

$ go run github.com/vvakame/spatk/cmd/sidx -output model_spanner_index.go ./db/schema.sql

sig

Spanner Information code Generator.

$ go run github.com/vvakame/spatk/cmd/sig -private -output model_spanner_info.go .

scur

Spanner CURsor constructor.

sqb

Spanner Query Builder.

How to test

Do this once.

$ export CLOUDSDK_ACTIVE_CONFIG_NAME=spatk-config
$ gcloud config configurations create --no-activate $CLOUDSDK_ACTIVE_CONFIG_NAME
$ gcloud config set auth/disable_credentials true
$ gcloud config set project spatk-test
$ gcloud config set api_endpoint_overrides/spanner http://localhost:9020/

Do this before runs test.

$ docker compose up -d --build --force-recreate
$ export CLOUDSDK_ACTIVE_CONFIG_NAME=spatk-config
$ export SPANNER_EMULATOR_INSTANCE_NAME=spatk-test-instance
$ gcloud spanner instances create "${SPANNER_EMULATOR_INSTANCE_NAME}" --config=emulator-config --nodes=1 --description "for testing"
$ export SPANNER_EMULATOR_HOST=localhost:9010
$ export SPANNER_EMULATOR_PROJECT_ID=spatk-test
$ export SPANNER_EMULATOR_INSTANCE_NAME=spatk-test-instance
$ export SPANNER_EMULATOR_DB_NAME=spatk-test-db
$ go test -v ./...
$ docker compose down

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
sig
internal
sig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL