Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 783e018

Browse files
Merge pull request #539 from stackql/version0.7-adapted
Version0.7
2 parents 6fa77e4 + 4749169 commit 783e018

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2945
-1904
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ issues:
318318
- gosec
319319
- noctx
320320
- revive
321+
- typecheck
321322
- wrapcheck
322323
output:
323324
formats:

.vscode/launch.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@
159159
"SELECT instance_id FROM aws.ec2.instances WHERE region IN ('us-east-1', 'ap-southeast-2');",
160160
"SELECT instance_id FROM aws.ec2_solid_gold.instances WHERE region IN ('us-east-1', 'ap-southeast-2');",
161161
"SELECT region FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id;",
162+
"begin; INSERT INTO digitalocean.droplets.droplets( data__name, data__region, data__size, data__image, data__backups, data__ipv6, data__monitoring, data__tags ) SELECT 'some.example.com', 'nyc3', 's-1vcpu-1gb', 'ubuntu-20-04-x64', true, true, true, '[\"env:prod\", \"web\"]' ; INSERT INTO digitalocean.droplets.droplets( data__name, data__region, data__size, data__image, data__backups, data__ipv6, data__monitoring, data__tags ) SELECT 'some.example.com', 'nyc3', 's-1vcpu-1gb', 'ubuntu-20-04-x64', true, true, true, '[\"env:prod\", \"web\"]' ; INSERT INTO digitalocean.droplets.droplets( data__name, data__region, data__size, data__image, data__backups, data__ipv6, data__monitoring, data__tags ) SELECT 'error.example.com', 'nyc3', 's-1vcpu-1gb', 'ubuntu-20-04-x64', true, true, true, '[\"env:prod\", \"web\"]' ; commit;",
163+
"select keyz.name as key_name, keyz.tags as key_tags, json_extract(detail.properties, '$.kty') as key_class, json_extract(detail.properties, '$.keySize') as key_size, json_extract(detail.properties, '$.keyOps') as key_ops, keyz.type as key_type from azure.key_vault.vaults vaultz inner join azure.key_vault.keys keyz on keyz.vaultName = split_part(vaultz.id, '/', -1) and keyz.subscriptionId = vaultz.subscriptionId and keyz.resourceGroupName = split_part(vaultz.id, '/', 5) inner join azure.key_vault.keys detail on detail.vaultName = split_part(vaultz.id, '/', -1) and detail.subscriptionId = '000000-0000-0000-0000-000000000022' and detail.resourceGroupName = split_part(vaultz.id, '/', 5) and detail.keyName = split_part(keyz.id, '/', -1) where vaultz.subscriptionId = '000000-0000-0000-0000-000000000022' order by key_name ;",
164+
"delete from aws.transfer.users where data__ServerId = 's-0000000001' and data__UserName = '[email protected]' and region = 'ap-southeast-2';",
165+
"select * from google.cloudkms.key_rings where projectsId = 'testing-project' and locationsId = 'australia-southeast1';",
166+
"delete from aws.cloud_control.resources where region = 'ap-southeast-1' and data__TypeName = 'AWS::Logs::LogGroup' and data__Identifier = 'LogGroupResourceExampleThird' ;",
167+
"EXEC aws.transfer.servers.stop_server @region = 'ap-southeast-2' @@json='{ \"ServerId\": \"s-0000000001\" }' ;",
168+
"exec aws.ec2.instances.instances_Stop @region = 'ap-southeast-2', @InstanceId = 'id-001' ;",
169+
"begin; insert into googleadmin.directory.users(data__primaryEmail) values ('[email protected]'); rollback;",
170+
"show methods in local_openssl.keys.rsa;",
171+
"insert into local_openssl.keys.rsa(config_file, key_out_file, cert_out_file, days) select '${workspaceFolder}/test/server/mtls/openssl.cnf', '${workspaceFolder}/test/tmp/manual_key.pem', '${workspaceFolder}/test/tmp/manuial_cert.pem', 90;",
172+
"describe local_openssl.keys.x509;",
173+
"select * from local_openssl.keys.x509 where cert_file = '/Users/admin/stackql/stackql-devel/test/tmp/manual_cert.pem';",
162174
],
163175
"default": "show providers;"
164176
},
@@ -187,10 +199,10 @@
187199
"description": "Auth Input arg String",
188200
"default": "{}",
189201
"options": [
190-
"{ \"azure\": { \"type\": \"azure_default\" }, \"digitalocean\": { \"type\": \"bearer\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/digitalocean-key.txt\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/ryuk-it-query.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
202+
"{ \"local_openssl\": { \"type\": \"null_auth\"}, \"azure\": { \"type\": \"azure_default\" }, \"digitalocean\": { \"type\": \"bearer\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/digitalocean-key.txt\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/ryuk-it-query.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
191203
"{ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/google/functional-test-dummy-sa-key.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/google/functional-test-dummy-sa-key.json\" },s \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/okta/api-key.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/okta/api-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/aws/functional-test-dummy-aws-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/netlify/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/k8s/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/sumologic/sumologic-token.txt\", \"type\": \"basic\" } }",
192204
"{ \"pgi\": { \"type\": \"sql_data_source::postgres\", \"sqlDataSource\": { \"dsn\": \"postgres://stackql:[email protected]:8432\" } }, \"azure\": { \"type\": \"azure_default\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
193-
"{ \"digitalocean\": { \"username_var\": \"DUMMY_DIGITALOCEAN_USERNAME\", \"password_var\": \"DUMMY_DIGITALOCEAN_PASSWORD\", \"type\": \"bearer\" } }",
205+
"{ \"digitalocean\": { \"username_var\": \"DUMMY_DIGITALOCEAN_USERNAME\", \"password_var\": \"DUMMY_DIGITALOCEAN_PASSWORD\", \"type\": \"bearer\" }, \"azure\": {\"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsenvvar\": \"AZ_ACCESS_TOKEN\"} }",
194206
"{}"
195207
]
196208
},

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ ENV PATH="${APP_DIR}:${PATH}"
161161
COPY --from=integration ${TEST_ROOT_DIR}/build/stackql ${APP_DIR}/
162162

163163
RUN apt-get update \
164-
&& apt-get install -y ca-certificates \
164+
&& apt-get install -y ca-certificates openssl \
165165
&& update-ca-certificates
166166

167167
EXPOSE ${STACKQL_PG_PORT}/tcp

cicd/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
MajorVersion=0
2-
MinorVersion=6
2+
MinorVersion=7

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ services:
4747
- ./test/assets/credentials/dummy:/opt/stackql/credentials/dummy:ro
4848
- ./test/assets/input:/opt/stackql/input:ro
4949
- ./test/tmp:/opt/test/tmp:rw
50+
- ./test/server:/opt/test/server:ro
5051
- ${DB_SETUP_SRC:-./test/db/sqlite}:/opt/stackql/db:ro
5152
- ${REGISTRY_SRC:-./test/registry-mocked}:/opt/stackql/registry:ro
5253
- ./cicd/vol/stackql/config:/opt/stackql/.stackql:rw

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/spf13/cobra v1.4.0
2020
github.com/spf13/pflag v1.0.5
2121
github.com/spf13/viper v1.10.1
22-
github.com/stackql/any-sdk v0.0.5-beta01
22+
github.com/stackql/any-sdk v0.1.2-alpha37
2323
github.com/stackql/go-suffix-map v0.0.1-alpha01
2424
github.com/stackql/psql-wire v0.1.1-alpha07
2525
github.com/stackql/stackql-parser v0.0.14-alpha05

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
482482
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
483483
github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
484484
github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU=
485-
github.com/stackql/any-sdk v0.0.5-beta01 h1:1KEAJC/IjOlxVLh385SecmLyDiERW+E3fFN2Rl7HMcY=
486-
github.com/stackql/any-sdk v0.0.5-beta01/go.mod h1:4jYKpPoX2GWEK+qBnlGLvr8SUfndiYwHMIkg1dn9tFM=
485+
github.com/stackql/any-sdk v0.1.2-alpha37 h1:bvU576YCwqtjztMD4wSpgj//StNH8qGoBRBnN6uOH1I=
486+
github.com/stackql/any-sdk v0.1.2-alpha37/go.mod h1:4jYKpPoX2GWEK+qBnlGLvr8SUfndiYwHMIkg1dn9tFM=
487487
github.com/stackql/go-suffix-map v0.0.1-alpha01 h1:TDUDS8bySu41Oo9p0eniUeCm43mnRM6zFEd6j6VUaz8=
488488
github.com/stackql/go-suffix-map v0.0.1-alpha01/go.mod h1:QAi+SKukOyf4dBtWy8UMy+hsXXV+yyEE4vmBkji2V7g=
489489
github.com/stackql/psql-wire v0.1.1-alpha07 h1:LQWVUlx4Bougk6dztDNG5tmXxpIVeeTSsInTj801xCs=

internal/stackql/data_staging/output_data_staging/packet_preparator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"github.com/lib/pq/oid"
77
"github.com/stackql/any-sdk/pkg/dto"
88
"github.com/stackql/any-sdk/pkg/logging"
9+
"github.com/stackql/any-sdk/pkg/streaming"
910
"github.com/stackql/stackql/internal/stackql/drm"
10-
"github.com/stackql/stackql/internal/stackql/streaming"
1111
"github.com/stackql/stackql/internal/stackql/typing"
1212
)
1313

internal/stackql/dependencyplanner/dependencyplanner.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/stackql/any-sdk/pkg/constants"
99
"github.com/stackql/any-sdk/pkg/logging"
1010
"github.com/stackql/any-sdk/pkg/media"
11+
"github.com/stackql/any-sdk/pkg/streaming"
1112
"github.com/stackql/stackql-parser/go/vt/sqlparser"
1213
"github.com/stackql/stackql/internal/stackql/astanalysis/annotatedast"
1314
"github.com/stackql/stackql/internal/stackql/astindirect"
@@ -22,7 +23,6 @@ import (
2223
"github.com/stackql/stackql/internal/stackql/primitivecomposer"
2324
"github.com/stackql/stackql/internal/stackql/sqlrewrite"
2425
"github.com/stackql/stackql/internal/stackql/sqlstream"
25-
"github.com/stackql/stackql/internal/stackql/streaming"
2626
"github.com/stackql/stackql/internal/stackql/tableinsertioncontainer"
2727
"github.com/stackql/stackql/internal/stackql/taxonomy"
2828
"github.com/stackql/stackql/internal/stackql/util"
@@ -407,7 +407,7 @@ func (dp *standardDependencyPlanner) processOrphan(
407407
} else {
408408
// Persist SQL mirror table here prior to generating insert DML
409409
drmCfg := dp.handlerCtx.GetDrmConfig()
410-
ddl, ddlErr := drmCfg.GenerateDDL(anTab, opStore, 0, false)
410+
ddl, ddlErr := drmCfg.GenerateDDL(anTab, opStore, 0, false, false)
411411
if ddlErr != nil {
412412
return nil, nil, ddlErr
413413
}
@@ -416,7 +416,7 @@ func (dp *standardDependencyPlanner) processOrphan(
416416
return nil, nil, err
417417
}
418418
}
419-
insPsc, err := dp.primitiveComposer.GetDRMConfig().GenerateInsertDML(anTab, opStore, tcc)
419+
insPsc, err := dp.primitiveComposer.GetDRMConfig().GenerateInsertDML(anTab, opStore, tcc, false)
420420
return insPsc, tcc, err
421421
}
422422

internal/stackql/dependencyplanner/stream_collection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dependencyplanner
22

33
import (
4-
"github.com/stackql/stackql/internal/stackql/streaming"
4+
"github.com/stackql/any-sdk/pkg/streaming"
55
)
66

77
type StreamDependecyCollection interface {

0 commit comments

Comments
 (0)