Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,74 @@
"--auth={ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/sa-key.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/okta-token.txt\", \"type\": \"api_key\" }, \"github\": { \"type\": \"null_auth\" } }",
"select name, ssh_url from github.repos.repos where org = 'stackql' ;"
],
},
{
"name": "DEBUG authenticated select github.repos.repos ... ;",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry={ \"useEmbedded\": false, \"url\": \"file://${workspaceFolder}/test/registry\", \"localDocRoot\": \"${workspaceFolder}/test/registry\", \"verifyConfig\": { \"nopVerify\": true } }",
"--auth={ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/sa-key.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/okta-token.txt\", \"type\": \"api_key\" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/keys/github-user-token.txt\" } }",
"select name, ssh_url from github.repos.repos where org = 'stackql' ;"
],
},
// select * from github.activity.starring where owner = 'stackql' and repo = 'stackql' limit 1;
{
"name": "DEBUG authenticated select github.activity.starring ... ;",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry={ \"useEmbedded\": false, \"url\": \"file://${workspaceFolder}/test/registry\", \"localDocRoot\": \"${workspaceFolder}/test/registry\", \"verifyConfig\": { \"nopVerify\": true } }",
"--auth={ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/sa-key.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/okta-token.txt\", \"type\": \"api_key\" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/keys/github-user-token.txt\" } }",
"select id from github.activity.starring where owner = 'stackql' and repo = 'stackql' limit 1;"
],
},
// describe github.activity.starring;
{
"name": "DEBUG describe github.activity.starring;",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry={ \"useEmbedded\": false, \"url\": \"file://${workspaceFolder}/test/registry\", \"localDocRoot\": \"${workspaceFolder}/test/registry\", \"verifyConfig\": { \"nopVerify\": true } }",
"--auth={ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/sa-key.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/okta-token.txt\", \"type\": \"api_key\" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/keys/github-user-token.txt\" } }",
"describe github.activity.starring;"
],
},
{
"name": "DEBUG authenticated select github.usrs.users ... ;",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry={ \"useEmbedded\": false, \"url\": \"file://${workspaceFolder}/test/registry\", \"localDocRoot\": \"${workspaceFolder}/test/registry\", \"verifyConfig\": { \"nopVerify\": true } }",
"--auth={ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/sa-key.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/okta-token.txt\", \"type\": \"api_key\" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/keys/github-user-token.txt\" } }",
"select login, url from github.users.users;"
],
},
// EXEC github.repos.repos.create_in_org @org='stackql', @body_name='test-r1';
{
"name": "DEBUG authenticated insert github.repos.repos ... ;",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry={ \"useEmbedded\": false, \"url\": \"file://${workspaceFolder}/test/registry\", \"localDocRoot\": \"${workspaceFolder}/test/registry\", \"verifyConfig\": { \"nopVerify\": true } }",
"--auth={ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/sa-key.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/keys/okta-token.txt\", \"type\": \"api_key\" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/keys/github-user-token.txt\" } }",
"EXEC github.repos.repos.create_in_org @org='stackql' @@json='{\"name\":\"test-r2\"}';"
],
},
// show extended resources from okta.group
{
Expand Down
18 changes: 16 additions & 2 deletions docs/developer_guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

# StackQL Developer Guide

## Quick walkthrough

### Running unit tests standalone

Some pretty hefty things, also the `json1` tag is a must.

```
go test -timeout 2400s -p 2 --tags "json1" ./...
```

## Provider development

Keen to expose some new functionality though `stackql`? We are very keen on this!
Expand Down Expand Up @@ -96,15 +106,19 @@ Really high level stuff:

## Tests

See also:

- [standalone unit tests](#running-unit-tests-standalone).

Building locally or in cloud will automatically:

1. Run `gotest` tests.
1. Run `go test` tests.
2. Build the executable.
3. Run integration tests.

[This article](https://medium.com/cbi-engineering/mocking-techniques-for-go-805c10f1676b) gives a nice overview of mocking in golang.

### gotest
### go test

Test coverage is sparse. Regressions are mitigated by `gotest` integration testing in the [driver](/internal/stackql/driver/driver_integration_test.go) and [stackql](/stackql/main_integration_test.go) packages. Some testing functionality is supported through convenience functionality inside the [test](/internal/test) packages.

Expand Down
77 changes: 48 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,62 +1,81 @@
module github.com/stackql/stackql

go 1.16
go 1.18

require (
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 // indirect
github.com/axiomhq/hyperloglog v0.0.0-20220105174342-98591331716a // indirect
github.com/biogo/store v0.0.0-20201120204734-aad293a2328f // indirect
github.com/cenk/backoff v2.2.1+incompatible // indirect
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
github.com/cockroachdb/circuitbreaker v2.2.1+incompatible // indirect
github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292 // indirect
github.com/cockroachdb/cockroach v20.1.17+incompatible
github.com/cockroachdb/cockroach-go v2.0.1+incompatible // indirect
github.com/cockroachdb/errors v1.9.0 // indirect
github.com/cockroachdb/ttycolor v0.0.0-20210902133924-c7d7dcdde4e8 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/fatih/color v1.13.0
github.com/getkin/kin-openapi v0.88.0
github.com/getsentry/raven-go v0.2.0 // indirect
github.com/google/flatbuffers v2.0.6+incompatible // indirect
github.com/google/go-jsonnet v0.17.0
github.com/jackc/pgtype v1.10.0
github.com/jackc/pgx v3.6.2+incompatible // indirect
github.com/jaegertracing/jaeger v1.32.0 // indirect
github.com/jeroenrinzema/psql-wire v0.0.1-stackqlalpha3
github.com/knz/strtime v0.0.0-20200924090105-187c67f2bf5e // indirect
github.com/lib/pq v1.10.4
github.com/lightstep/lightstep-tracer-go v0.25.0 // indirect
github.com/magiconair/properties v1.8.6
github.com/marusama/semaphore v0.0.0-20190110074507-6952cef993b2 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/montanaflynn/stats v0.6.6 // indirect
github.com/olekukonko/tablewriter v0.0.0-20180130162743-b8a9be070da4
github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5 // indirect
github.com/petermattis/goid v0.0.0-20220302125637-5f11c28912df // indirect
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.1
github.com/stackql/go-openapistackql v0.0.6-beta04
github.com/stackql/go-openapistackql v0.0.6-beta24
github.com/stackql/go-sqlite3 v0.0.1-stackqlrc01
github.com/stackql/go-suffix-map v0.0.1-alpha01
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20220214200702-86341886e292
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
gonum.org/v1/gonum v0.9.3
gonum.org/v1/gonum v0.11.0
gopkg.in/yaml.v2 v2.4.0
gotest.tools v2.2.0+incompatible
readline v0.0.0-00010101000000-000000000000
vitess.io/vitess v0.0.11-alpha04
)

require (
cloud.google.com/go v0.99.0 // indirect
github.com/Masterminds/semver v1.4.2 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stackql/go-spew v1.1.3-alpha24 // indirect
github.com/stackql/stackql-provider-registry v0.0.1-rc01 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.9 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
)

replace readline => github.com/stackql/readline v0.0.1-rc01

replace github.com/fatih/color => github.com/stackql/color v0.0.1-rc01

replace vitess.io/vitess => github.com/stackql/vitess v0.0.11-alpha04
replace vitess.io/vitess => github.com/stackql/vitess v0.0.11-alpha05

replace github.com/jeroenrinzema/psql-wire => github.com/stackql/psql-wire v0.0.1-stackqlrc01
Loading