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

Skip to content

Commit 6c58a65

Browse files
analysis-uplift (#570)
Summary: - Client driven `async`. - Better test diagnostics. - New `anysdk` API. - `base64` encoding correction. - Improved `any-sdk`.
1 parent 3492a80 commit 6c58a65

File tree

9 files changed

+25
-11
lines changed

9 files changed

+25
-11
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/spf13/cobra v1.4.0
1717
github.com/spf13/pflag v1.0.5
1818
github.com/spf13/viper v1.10.1
19-
github.com/stackql/any-sdk v0.2.2-beta01
19+
github.com/stackql/any-sdk v0.2.2-beta05
2020
github.com/stackql/go-suffix-map v0.0.1-alpha01
2121
github.com/stackql/psql-wire v0.1.1-beta23
2222
github.com/stackql/stackql-parser v0.0.15-alpha06

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
461461
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
462462
github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
463463
github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU=
464-
github.com/stackql/any-sdk v0.2.2-beta01 h1:h5VIvulaqujDmFAN0j0KS0VONE3pwARIzPs6EFiM5G0=
465-
github.com/stackql/any-sdk v0.2.2-beta01/go.mod h1:m1o5TCfyKkdt2bREB3itwPv1MhM+lk4eu24KpPohFoY=
464+
github.com/stackql/any-sdk v0.2.2-beta05 h1:xUQH2EMgTBFWRbyu6QlKxFzJ3btMtqO+Lc9VkUmYPc4=
465+
github.com/stackql/any-sdk v0.2.2-beta05/go.mod h1:m1o5TCfyKkdt2bREB3itwPv1MhM+lk4eu24KpPohFoY=
466466
github.com/stackql/go-suffix-map v0.0.1-alpha01 h1:TDUDS8bySu41Oo9p0eniUeCm43mnRM6zFEd6j6VUaz8=
467467
github.com/stackql/go-suffix-map v0.0.1-alpha01/go.mod h1:QAi+SKukOyf4dBtWy8UMy+hsXXV+yyEE4vmBkji2V7g=
468468
github.com/stackql/psql-wire v0.1.1-beta23 h1:1ayYMjZArfDcIMyEOKnm+Bp1zRCISw8pguvTFuUhhVQ=

internal/stackql/drm/drm_cfg.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,13 @@ func (dc *staticDRMConfig) obtainAddressSpace(
496496
}
497497

498498
func (dc *staticDRMConfig) obtainRelationFromAddressSpace(
499+
isAwait bool,
499500
addressSpace anysdk.AddressSpace,
500501
isNilResponseAllowed bool,
501502
) (anysdk.Relation, error) {
502503
inferredRelation, inferredRelationErr := addressSpace.ToRelation(
503504
radix_tree_address_space.NewStandardAddressSpaceExpansionConfig(
505+
isAwait,
504506
true, // TODO: switch this off at the appropriate time
505507
isNilResponseAllowed,
506508
))
@@ -541,7 +543,7 @@ func (dc *staticDRMConfig) genRelationalTable(
541543
return nil, err
542544
}
543545
}
544-
inferredRelation, inferredRelationErr := dc.obtainRelationFromAddressSpace(addressSpace, isNilResponseAllowed)
546+
inferredRelation, inferredRelationErr := dc.obtainRelationFromAddressSpace(isAwait, addressSpace, isNilResponseAllowed)
545547
if inferredRelationErr != nil {
546548
return nil, inferredRelationErr
547549
}
@@ -635,6 +637,7 @@ func (dc *staticDRMConfig) GenerateInsertDML(
635637
return nil, addressSpaceErr
636638
}
637639
inferredRelation, relationErr := dc.obtainRelationFromAddressSpace(
640+
isAsync,
638641
addressSpace,
639642
isNilResponseAllowed,
640643
)

internal/stackql/primitivebuilder/generic_http_reversal.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ func (gh *genericHTTPReversal) Build() error {
133133
if !httpPreparatorExists {
134134
break
135135
}
136-
httpArmoury, httpErr := httpPreparator.BuildHTTPRequestCtx()
136+
httpArmoury, httpErr := httpPreparator.BuildHTTPRequestCtx(
137+
anysdk.NewHTTPPreparatorConfig(false),
138+
)
137139
if httpErr != nil {
138140
return internaldto.NewErroneousExecutorOutput(httpErr)
139141
}

internal/stackql/primitivebuilder/generic_http_stream_input.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ func (gh *genericHTTPStreamInput) Build() error {
269269
nil,
270270
logging.GetLogger(),
271271
)
272-
httpArmoury, httpErr := httpPreparator.BuildHTTPRequestCtx()
272+
httpArmoury, httpErr := httpPreparator.BuildHTTPRequestCtx(
273+
anysdk.NewHTTPPreparatorConfig(false),
274+
)
273275
if httpErr != nil {
274276
return internaldto.NewErroneousExecutorOutput(httpErr)
275277
}

internal/stackql/primitivegenerator/statement_analyzer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,9 @@ func (pb *standardPrimitiveGenerator) buildRequestContextFromMapArray(
10181018
execContext,
10191019
logging.GetLogger(),
10201020
)
1021-
httpArmoury, httpErr := httpPreparator.BuildHTTPRequestCtx()
1021+
httpArmoury, httpErr := httpPreparator.BuildHTTPRequestCtx(
1022+
anysdk.NewHTTPPreparatorConfig(false),
1023+
)
10221024
if httpErr != nil {
10231025
return nil, httpErr
10241026
}

internal/stackql/primitivegenerator/unary_selection.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ func (pb *standardPrimitiveGenerator) analyzeUnarySelection(
208208
}
209209
inferredRelation, inferredRelationErr := addressSpace.ToRelation(
210210
radix_tree_address_space.NewStandardAddressSpaceExpansionConfig(
211+
methodAnalysisOutput.IsAwait(),
211212
true, // TODO: switch this off at the appropriate time
212213
false,
213214
))

internal/stackql/psqlwire/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ func MakeWireServer(sbe sqlbackend.SQLBackendFactory, cfg dto.RuntimeCtx) (IWire
6464
cp = x509.NewCertPool()
6565
for _, pemStr := range tlsCfg.ClientCAs {
6666
var b []byte
67-
b, err = base64.RawStdEncoding.DecodeString(pemStr)
67+
b, err = base64.StdEncoding.DecodeString(pemStr)
6868
if err != nil {
69-
return nil, err
69+
return nil, fmt.Errorf("failed to decode Client CA PEM: %w, with string '%s'", err, pemStr)
7070
}
7171
ok := cp.AppendCertsFromPEM(b)
7272
if !ok {

internal/stackql/taxonomy/annotation_context.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ func (ac *standardAnnotationCtx) Prepare(
179179
nil,
180180
logging.GetLogger(),
181181
)
182-
httpArmoury, armouryErr := httpPreparator.BuildHTTPRequestCtxFromAnnotation()
182+
httpArmoury, armouryErr := httpPreparator.BuildHTTPRequestCtx(
183+
anysdk.NewHTTPPreparatorConfig(true),
184+
)
183185
return httpArmoury, armouryErr
184186
},
185187
)
@@ -211,7 +213,9 @@ func (ac *standardAnnotationCtx) Prepare(
211213
nil,
212214
logging.GetLogger(),
213215
)
214-
httpArmoury, armouryErr := httpPreparator.BuildHTTPRequestCtxFromAnnotation()
216+
httpArmoury, armouryErr := httpPreparator.BuildHTTPRequestCtx(
217+
anysdk.NewHTTPPreparatorConfig(true),
218+
)
215219
if armouryErr != nil {
216220
return nil, armouryErr
217221
}

0 commit comments

Comments
 (0)