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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ y.output

## Python
*.pyc

.stackql/
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"select * from aws_cc_bucket_unfiltered where data__Identifier = 'stackql-trial-bucket-01';",
"create or replace view self_created as select id, name, url from github.repos.repos where org = 'stackql';",
"drop view if exists self_created ; ",
"registry pull azure v23.01.00102 ; "
"registry pull azure v23.01.00102 ; ",
"registry pull azure ; "
],
"default": "show providers;"
},
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
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.10-beta23
github.com/stackql/go-openapistackql v0.0.10-beta26
github.com/stackql/go-sqlite3 v0.0.2-stackqlbeta04
github.com/stackql/go-suffix-map v0.0.1-alpha01
github.com/xo/dburl v0.12.4
Expand Down Expand Up @@ -98,6 +98,6 @@ replace github.com/chzyer/readline => github.com/stackql/readline v0.0.2-alpha05

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

replace vitess.io/vitess => github.com/stackql/vitess v0.0.12-alpha05
replace vitess.io/vitess => github.com/stackql/vitess v0.0.12-alpha06

replace github.com/jeroenrinzema/psql-wire => github.com/stackql/psql-wire v0.0.2-stackqlbeta14
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU=
github.com/stackql/color v0.0.1-rc01 h1:fq3Gj6gwskaZnQrDXfFYnDP6JyayGHy6Dp7I5P/V2u0=
github.com/stackql/color v0.0.1-rc01/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/stackql/go-openapistackql v0.0.10-beta23 h1:PZBYQWUYlEo7J9CJy+Y7KVe4YAubFZ00oZ84sAfoOuo=
github.com/stackql/go-openapistackql v0.0.10-beta23/go.mod h1:lhOGbSlnioAbK8nFAIyvTkGkY7s5Sumz3fVnr81CfaQ=
github.com/stackql/go-openapistackql v0.0.10-beta26 h1:Ffj/ogeC4QwYUJAB1EOHBowBaBlMjcCM4JRpxlM9QkY=
github.com/stackql/go-openapistackql v0.0.10-beta26/go.mod h1:lhOGbSlnioAbK8nFAIyvTkGkY7s5Sumz3fVnr81CfaQ=
github.com/stackql/go-spew v1.1.3-alpha24 h1:yNmgWU+OKU8SvlQ0umiQWWgWS6C5U1GuRMlYfQgbmJA=
github.com/stackql/go-spew v1.1.3-alpha24/go.mod h1:o2MPqg2ee1PN4SxAh9zQSJJmKKFJjpro9pejdK7dXWk=
github.com/stackql/go-sqlite3 v0.0.2-stackqlbeta04 h1:OjtVf98ZZ8DJ0kWuV1J03hCxkfplPjpa8DDgENzHSyA=
Expand All @@ -684,8 +684,8 @@ github.com/stackql/readline v0.0.2-alpha05 h1:ID4QzGdplFBsrSnTuz8pvKzWw96JbrJg8f
github.com/stackql/readline v0.0.2-alpha05/go.mod h1:OFAYOdXk/X4+5GYiDXFfaGrk+bCN6Qv0SYY5HNzD2E0=
github.com/stackql/stackql-provider-registry v0.0.1-rc01 h1:3XorfaYEhGpuvEeQK04EmpZUCr42hZ/a4Nh3wE25LF0=
github.com/stackql/stackql-provider-registry v0.0.1-rc01/go.mod h1:D0WFWa7HOXS+PQAmvN0Nm1E6dMdUkUFtAzRH8cXxg88=
github.com/stackql/vitess v0.0.12-alpha05 h1:x1USpVIQwsB1fo+xFQKBg3R0FYLMvDJxZ6hMMgzAOjs=
github.com/stackql/vitess v0.0.12-alpha05/go.mod h1:6aOZHbgHclTasEGZvrdoWfca6Y4XJfemKMqwnDL/klI=
github.com/stackql/vitess v0.0.12-alpha06 h1:05rpWs895wB46X6DzapzvhLoQ/b5Y08m1sLele80bqo=
github.com/stackql/vitess v0.0.12-alpha06/go.mod h1:6aOZHbgHclTasEGZvrdoWfca6Y4XJfemKMqwnDL/klI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
Expand Down
12 changes: 10 additions & 2 deletions internal/stackql/planbuilder/plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,19 @@ func (pgb *planGraphBuilder) handleRegistry(pbi planbuilderinput.PlanBuilderInpu
func(pc primitive.IPrimitiveCtx) internaldto.ExecutorOutput {
switch at := strings.ToLower(node.ActionType); at {
case "pull":
err := reg.PullAndPersistProviderArchive(node.ProviderId, node.ProviderVersion)
var err error
providerVersion := node.ProviderVersion
if providerVersion == "" {
providerVersion, err = reg.GetLatestPublishedVersion(node.ProviderId)
}
if err != nil {
return internaldto.NewErroneousExecutorOutput(err)
}
err = reg.PullAndPersistProviderArchive(node.ProviderId, providerVersion)
if err != nil {
return internaldto.NewErroneousExecutorOutput(err)
}
return util.PrepareResultSet(internaldto.NewPrepareResultSetPlusRawDTO(nil, nil, nil, nil, nil, &internaldto.BackendMessages{WorkingMessages: []string{fmt.Sprintf("%s provider, version '%s' successfully installed", node.ProviderId, node.ProviderVersion)}}, nil))
return util.PrepareResultSet(internaldto.NewPrepareResultSetPlusRawDTO(nil, nil, nil, nil, nil, &internaldto.BackendMessages{WorkingMessages: []string{fmt.Sprintf("%s provider, version '%s' successfully installed", node.ProviderId, providerVersion)}}, nil))
case "list":
var colz []string
var provz map[string]openapistackql.ProviderDescription
Expand Down
10 changes: 5 additions & 5 deletions test/assets/expected/registry/google-list.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
|----------|------------------------|
| provider | versions |
|----------|------------------------|
| google | v0.1.0, v0.1.1, v0.1.2 |
|----------|------------------------|
|----------|--------------------------------|
| provider | versions |
|----------|--------------------------------|
| google | v0.1.0, v0.1.1-alpha01, v0.1.2 |
|----------|--------------------------------|
Loading