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
53 changes: 47 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"options": [
"{ \"url\": \"file://${workspaceFolder}/test/registry-sandbox\", \"localDocRoot\": \"${workspaceFolder}/test/registry-sandbox\", \"verifyConfig\": { \"nopVerify\": true } }",
"{ \"url\": \"file://${workspaceFolder}/test/registry\", \"localDocRoot\": \"${workspaceFolder}/test/registry\", \"verifyConfig\": { \"nopVerify\": true } }",
"{ \"url\": \"https://cdn.statically.io/gh/stackql/stackql-provider-registry/feature/reset-provider-versions-02/providers\" }",
"{ \"url\": \"https://cdn.statically.io/gh/stackql/stackql-provider-registry/feature/github-v-0-3-0/providers\" }",
"{ \"url\": \"https://cdn.statically.io/gh/stackql/stackql-provider-registry/feature/add-github-provider-published-05/providers\" }"
],
"default": "{ \"url\": \"file://${workspaceFolder}/test/registry-sandbox\", \"localDocRoot\": \"${workspaceFolder}/test/registry-sandbox\", \"verifyConfig\": { \"nopVerify\": true } }"
Expand Down Expand Up @@ -192,7 +192,7 @@
},
// describe github.activity.starring;
{
"name": "DEBUG describe github.activity.starring;",
"name": "DEBUG describe github.repos.pages;",
"type": "go",
"request": "launch",
"mode": "debug",
Expand All @@ -201,7 +201,48 @@
"exec",
"--registry=${input:registryString}",
"--auth=${input:authString}",
"describe github.activity.starring;"
"describe github.repos.pages;"
],
},
// describe github.repos.statistics_code_frequency;
{
"name": "DEBUG describe github.repos.statistics_code_frequency;",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry=${input:registryString}",
"--auth=${input:authString}",
"describe github.repos.statistics_code_frequency;"
],
},
// select id from github.repos.repos where org = 'stackql';
{
"name": "DEBUG select id from github.repos.repos where org = 'stackql';",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry=${input:registryString}",
"--auth=${input:authString}",
"select id from github.repos.repos where org = 'stackql';"
],
},
{
"name": "DEBUG select url from github.repos.pages where owner = 'stackql' and repo = 'fullstackchronicles.io';",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/stackql",
"args": [
"exec",
"--registry=${input:registryString}",
"--auth=${input:authString}",
"select url from github.repos.pages where owner = 'stackql' and repo = 'fullstackchronicles.io';"
],
},
{
Expand Down Expand Up @@ -274,7 +315,7 @@
},
// ' registry pull okta
{
"name": "DEBUG pull okta v0.1.0 ;",
"name": "DEBUG pull github v0.3.0 ;",
"type": "go",
"request": "launch",
"mode": "debug",
Expand All @@ -284,8 +325,8 @@
"--registry=${input:registryString}",
"--auth=${input:authString}",
"pull",
"okta",
"v0.1.0"
"github",
"v0.3.0"
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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.7-beta03
github.com/stackql/go-openapistackql v0.0.7-beta04
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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@ github.com/stackql/go-openapistackql v0.0.7-beta01 h1:j9sQ/VzDIvd+2LWRsCvKZFWV8z
github.com/stackql/go-openapistackql v0.0.7-beta01/go.mod h1:eh1rztQzASRLNc4lhGEsPcGQdMUA6N0zzUyQ21djjzY=
github.com/stackql/go-openapistackql v0.0.7-beta03 h1:+Pooz2yKBjTK1E5lIhpdqN5XUZMMSa60rtzQi2i1aOA=
github.com/stackql/go-openapistackql v0.0.7-beta03/go.mod h1:eh1rztQzASRLNc4lhGEsPcGQdMUA6N0zzUyQ21djjzY=
github.com/stackql/go-openapistackql v0.0.7-beta04 h1:vSWw4dGCj5tGEa4qBpRrsuGYOdMh6obezRQ1UEy0OmQ=
github.com/stackql/go-openapistackql v0.0.7-beta04/go.mod h1:eh1rztQzASRLNc4lhGEsPcGQdMUA6N0zzUyQ21djjzY=
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.1-stackqlrc01 h1:q+LfCfPrIqqG5+v9T5xjyYzOEBB4i77Ek10Lzwyd0D4=
Expand Down
20 changes: 4 additions & 16 deletions internal/stackql/astvisit/astvisit.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,20 +764,8 @@ func (v *DRMAstVisitor) Visit(node sqlparser.SQLNode) error {
if node.IsEmpty() {
return nil
}
buf.AstPrintf(node, `"`)
if !node.QualifierThird.IsEmpty() {
buf.AstPrintf(node, "%v.", node.QualifierThird)
}
if !node.QualifierSecond.IsEmpty() {
buf.AstPrintf(node, "%v.", node.QualifierSecond)
}
if !node.Qualifier.IsEmpty() {
buf.AstPrintf(node, "%v.", node.Qualifier)
}
buf.AstPrintf(node, "%v", node.Name)
buf.AstPrintf(node, `"`)
rq := buf.String()
v.rewrittenQuery = rq
str := fmt.Sprintf(`"%s"`, node.GetRawVal())
v.rewrittenQuery = str

case *sqlparser.ParenTableExpr:
buf.AstPrintf(node, "(%v)", node.Exprs)
Expand Down Expand Up @@ -1151,8 +1139,8 @@ func (v *DRMAstVisitor) Visit(node sqlparser.SQLNode) error {
v.rewrittenQuery = buf.String()

case sqlparser.TableIdent:
sqlparser.FormatID(buf, node.GetRawVal(), strings.ToLower(node.GetRawVal()), sqlparser.NoAt)
v.rewrittenQuery = buf.String()
tn := node.GetRawVal()
v.rewrittenQuery = tn

case *sqlparser.IsolationLevel:
buf.WriteString("isolation level " + node.Level)
Expand Down
1 change: 1 addition & 0 deletions test/assets/credentials/dummy/github/github-key.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
some-dummy-github-key
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
|-----------|
| id |
|-----------|
| 100000001 |
|-----------|
| 100000002 |
|-----------|
| 100000003 |
|-----------|
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
|---------------------------------------------------------|
| url |
|---------------------------------------------------------|
| https://api.github.com/repos/dummyorg/dummyapp.io/pages |
|---------------------------------------------------------|
Loading