Skip to content

Commit 1b39e63

Browse files
- Unit tests working and type transference in place.
1 parent cf7b63a commit 1b39e63

File tree

10 files changed

+36
-36
lines changed

10 files changed

+36
-36
lines changed

internal/stackql/dependencyplanner/dependencyplanner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func (dp *standardDependencyPlanner) processOrphan(
399399
return nil, nil, err
400400
}
401401
_, isSQLDataSource := annotationCtx.GetTableMeta().GetSQLDataSource()
402-
var opStore anysdk.OperationStore
402+
var opStore anysdk.StandardOperationStore
403403
if !isSQLDataSource {
404404
opStore, err = annotationCtx.GetTableMeta().GetMethod()
405405
if err != nil {

internal/stackql/docparser/doc_parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func OpenapiStackQLTabulationsPersistor(
3737
prov anysdk.Provider,
3838
svc anysdk.Service,
3939
resource anysdk.Resource,
40-
m anysdk.OperationStore,
40+
m anysdk.StandardOperationStore,
4141
tabluationsAnnotated []util.AnnotatedTabulation,
4242
dbEngine sqlengine.SQLEngine,
4343
prefix string,

internal/stackql/drm/drm_cfg.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010

1111
"github.com/stackql/any-sdk/anysdk"
12+
"github.com/stackql/any-sdk/pkg/client"
1213
"github.com/stackql/any-sdk/pkg/constants"
1314
"github.com/stackql/any-sdk/pkg/db/sqlcontrol"
1415
"github.com/stackql/any-sdk/pkg/logging"
@@ -47,7 +48,7 @@ type Config interface {
4748
) (map[string]map[string]interface{}, map[int]map[int]interface{})
4849
GetCurrentTable(internaldto.HeirarchyIdentifiers) (internaldto.DBTable, error)
4950
GetRelationalType(string) string
50-
GenerateDDL(util.AnnotatedTabulation, anysdk.Provider, anysdk.Service, anysdk.Resource, anysdk.OperationStore, int, bool, bool) ([]string, error)
51+
GenerateDDL(util.AnnotatedTabulation, anysdk.Provider, anysdk.Service, anysdk.Resource, anysdk.StandardOperationStore, int, bool, bool) ([]string, error)
5152
GetControlAttributes() sqlcontrol.ControlAttributes
5253
GetGolangValue(string) interface{}
5354
GetGolangSlices([]typing.ColumnMetadata) ([]interface{}, []string)
@@ -455,7 +456,7 @@ func (dc *staticDRMConfig) genRelationalTable(
455456
prov anysdk.Provider,
456457
svc anysdk.Service,
457458
resource anysdk.Resource,
458-
m anysdk.OperationStore,
459+
m anysdk.StandardOperationStore,
459460
discoveryGenerationID int,
460461
isNilResponseAlloed bool,
461462
) (relationaldto.RelationalTable, error) {
@@ -487,16 +488,15 @@ func (dc *staticDRMConfig) genRelationalTable(
487488
relationalColumn := typing.NewRelationalColumn(colName, colType).WithWidth(colWidth)
488489
relationalTable.PushBackColumn(relationalColumn)
489490
}
490-
//nolint:lll // acceptable
491-
method, isOpenApiMethod := m.(anysdk.StandardOperationStore)
492-
if isOpenApiMethod {
491+
protocolType, _ := prov.GetProtocolType()
492+
if protocolType == client.HTTP {
493493
addressSpaceFormulator := radix_tree_address_space.NewAddressSpaceFormulator(
494494
radix_tree_address_space.NewAddressSpaceGrammar(),
495495
prov,
496496
svc,
497497
resource,
498-
method,
499-
method.GetProjections(),
498+
m,
499+
m.GetProjections(),
500500
)
501501
addressSpaceErr := addressSpaceFormulator.Formulate()
502502
if addressSpaceErr != nil {
@@ -520,7 +520,7 @@ func (dc *staticDRMConfig) GenerateDDL(
520520
prov anysdk.Provider,
521521
svc anysdk.Service,
522522
resource anysdk.Resource,
523-
m anysdk.OperationStore,
523+
m anysdk.StandardOperationStore,
524524
discoveryGenerationID int,
525525
dropTable bool,
526526
isNilResponseAlloed bool,

internal/stackql/internal_data_transfer/internaldto/heirarchy.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ type Heirarchy interface {
1515
GetServiceHdl() anysdk.Service
1616
GetResource() anysdk.Resource
1717
GetMethodSet() anysdk.MethodSet
18-
GetMethod() anysdk.OperationStore
18+
GetMethod() anysdk.StandardOperationStore
1919
SetServiceHdl(anysdk.Service)
2020
SetResource(anysdk.Resource)
2121
SetMethodSet(anysdk.MethodSet)
22-
SetMethod(anysdk.OperationStore)
22+
SetMethod(anysdk.StandardOperationStore)
2323
SetMethodStr(string)
2424
}
2525

@@ -34,7 +34,7 @@ type standardHeirarchy struct {
3434
serviceHdl anysdk.Service
3535
resource anysdk.Resource
3636
methodSet anysdk.MethodSet
37-
method anysdk.OperationStore
37+
method anysdk.StandardOperationStore
3838
}
3939

4040
func (hr *standardHeirarchy) SetServiceHdl(sh anysdk.Service) {
@@ -53,7 +53,7 @@ func (hr *standardHeirarchy) SetMethodStr(mStr string) {
5353
hr.hIDs.SetMethodStr(mStr)
5454
}
5555

56-
func (hr *standardHeirarchy) SetMethod(ost anysdk.OperationStore) {
56+
func (hr *standardHeirarchy) SetMethod(ost anysdk.StandardOperationStore) {
5757
hr.method = ost
5858
}
5959

@@ -69,7 +69,7 @@ func (hr *standardHeirarchy) GetMethodSet() anysdk.MethodSet {
6969
return hr.methodSet
7070
}
7171

72-
func (hr *standardHeirarchy) GetMethod() anysdk.OperationStore {
72+
func (hr *standardHeirarchy) GetMethod() anysdk.StandardOperationStore {
7373
return hr.method
7474
}
7575

internal/stackql/methodselect/methodselect.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
)
1010

1111
type IMethodSelector interface {
12-
GetMethod(resource anysdk.Resource, methodName string) (anysdk.OperationStore, error)
12+
GetMethod(resource anysdk.Resource, methodName string) (anysdk.StandardOperationStore, error)
1313

1414
GetMethodForAction(
1515
resource anysdk.Resource,
1616
iqlAction string,
17-
parameters parserutil.ColumnKeyedDatastore) (anysdk.OperationStore, string, error)
17+
parameters parserutil.ColumnKeyedDatastore) (anysdk.StandardOperationStore, string, error)
1818
}
1919

2020
func NewMethodSelector(provider string, version string) (IMethodSelector, error) {
@@ -37,7 +37,7 @@ type DefaultMethodSelector struct {
3737
func (sel *DefaultMethodSelector) GetMethodForAction(
3838
resource anysdk.Resource,
3939
iqlAction string,
40-
parameters parserutil.ColumnKeyedDatastore) (anysdk.OperationStore, string, error) {
40+
parameters parserutil.ColumnKeyedDatastore) (anysdk.StandardOperationStore, string, error) {
4141
var methodName string
4242
switch strings.ToLower(iqlAction) {
4343
case "select":
@@ -60,12 +60,12 @@ func (sel *DefaultMethodSelector) GetMethodForAction(
6060
}
6161

6262
func (sel *DefaultMethodSelector) GetMethod(
63-
resource anysdk.Resource, methodName string) (anysdk.OperationStore, error) {
63+
resource anysdk.Resource, methodName string) (anysdk.StandardOperationStore, error) {
6464
return sel.getMethodByName(resource, methodName)
6565
}
6666

6767
func (sel *DefaultMethodSelector) getMethodByName(
68-
resource anysdk.Resource, methodName string) (anysdk.OperationStore, error) {
68+
resource anysdk.Resource, methodName string) (anysdk.StandardOperationStore, error) {
6969
m, err := resource.FindMethod(methodName)
7070
if err != nil {
7171
return nil, fmt.Errorf("no method = '%s' for resource = '%s'", methodName, resource.GetName())
@@ -75,7 +75,7 @@ func (sel *DefaultMethodSelector) getMethodByName(
7575

7676
func (sel *DefaultMethodSelector) getMethodByNameAndParameters(
7777
resource anysdk.Resource, methodName string,
78-
parameters parserutil.ColumnKeyedDatastore) (anysdk.OperationStore, error) {
78+
parameters parserutil.ColumnKeyedDatastore) (anysdk.StandardOperationStore, error) {
7979
stringifiedParams := parameters.GetStringified()
8080
m, remainingParams, ok := resource.GetFirstMethodMatchFromSQLVerb(methodName, stringifiedParams)
8181
if !ok {

internal/stackql/provider/generic.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (gp *GenericProvider) GetMethodForAction(
145145
iqlAction string,
146146
parameters parserutil.ColumnKeyedDatastore,
147147
runtimeCtx dto.RuntimeCtx,
148-
) (anysdk.OperationStore, string, error) {
148+
) (anysdk.StandardOperationStore, string, error) {
149149
rsc, err := gp.GetResource(serviceName, resourceName, runtimeCtx)
150150
if err != nil {
151151
return nil, "", err
@@ -158,7 +158,7 @@ func (gp *GenericProvider) GetFirstMethodForAction(
158158
resourceName string,
159159
iqlAction string,
160160
runtimeCtx dto.RuntimeCtx,
161-
) (anysdk.OperationStore, string, error) {
161+
) (anysdk.StandardOperationStore, string, error) {
162162
rsc, err := gp.GetResource(serviceName, resourceName, runtimeCtx)
163163
if err != nil {
164164
return nil, "", err
@@ -172,7 +172,7 @@ func (gp *GenericProvider) GetFirstMethodForAction(
172172

173173
func (gp *GenericProvider) InferDescribeMethod(
174174
rsc anysdk.Resource,
175-
) (anysdk.OperationStore, string, error) {
175+
) (anysdk.StandardOperationStore, string, error) {
176176
if rsc == nil {
177177
return nil, "", fmt.Errorf("cannot infer describe method from nil resource")
178178
}

internal/stackql/provider/provider.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type IProvider interface {
5353
serviceName string,
5454
resourceName string,
5555
iqlAction string,
56-
runtimeCtx dto.RuntimeCtx) (anysdk.OperationStore, string, error)
56+
runtimeCtx dto.RuntimeCtx) (anysdk.StandardOperationStore, string, error)
5757

5858
GetLikeableColumns(string) []string
5959

@@ -62,7 +62,7 @@ type IProvider interface {
6262
resourceName string,
6363
iqlAction string,
6464
parameters parserutil.ColumnKeyedDatastore,
65-
runtimeCtx dto.RuntimeCtx) (anysdk.OperationStore, string, error)
65+
runtimeCtx dto.RuntimeCtx) (anysdk.StandardOperationStore, string, error)
6666

6767
GetMethodSelector() methodselect.IMethodSelector
6868

@@ -91,7 +91,7 @@ type IProvider interface {
9191

9292
GetVersion() string
9393

94-
InferDescribeMethod(anysdk.Resource) (anysdk.OperationStore, string, error)
94+
InferDescribeMethod(anysdk.Resource) (anysdk.StandardOperationStore, string, error)
9595

9696
InferMaxResultsElement(anysdk.OperationStore) sdk_internal_dto.HTTPElement
9797

internal/stackql/tablemetadata/extended_table_metadata.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type ExtendedTableMetadata interface {
2020
GetHeirarchyObjects() HeirarchyObjects
2121
GetHTTPArmoury() (anysdk.HTTPArmoury, error)
2222
GetInputTableName() (string, error)
23-
GetMethod() (anysdk.OperationStore, error)
23+
GetMethod() (anysdk.StandardOperationStore, error)
2424
GetMethodStr() (string, error)
2525
GetProvider() (provider.IProvider, error)
2626
GetProviderStr() (string, error)
@@ -298,11 +298,11 @@ func (ex *standardExtendedTableMetadata) GetResource() (anysdk.Resource, error)
298298
return ex.heirarchyObjects.GetResource(), nil
299299
}
300300

301-
func (ex *standardExtendedTableMetadata) GetMethod() (anysdk.OperationStore, error) {
301+
func (ex *standardExtendedTableMetadata) GetMethod() (anysdk.StandardOperationStore, error) {
302302
return ex.getMethod()
303303
}
304304

305-
func (ex *standardExtendedTableMetadata) getMethod() (anysdk.OperationStore, error) {
305+
func (ex *standardExtendedTableMetadata) getMethod() (anysdk.StandardOperationStore, error) {
306306
if ex.heirarchyObjects == nil || ex.heirarchyObjects.GetMethod() == nil {
307307
return nil, fmt.Errorf("cannot resolve Method")
308308
}

internal/stackql/tablemetadata/hierarchy_objects.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ type HeirarchyObjects interface {
3232
GetServiceHdl() anysdk.Service
3333
GetResource() anysdk.Resource
3434
GetMethodSet() anysdk.MethodSet
35-
GetMethod() anysdk.OperationStore
36-
SetMethod(anysdk.OperationStore)
35+
GetMethod() anysdk.StandardOperationStore
36+
SetMethod(anysdk.StandardOperationStore)
3737
SetMethodSet(anysdk.MethodSet)
3838
SetMethodStr(string)
3939
SetResource(anysdk.Resource)
@@ -98,7 +98,7 @@ func (ho *standardHeirarchyObjects) GetMethodSet() anysdk.MethodSet {
9898
return ho.hr.GetMethodSet()
9999
}
100100

101-
func (ho *standardHeirarchyObjects) GetMethod() anysdk.OperationStore {
101+
func (ho *standardHeirarchyObjects) GetMethod() anysdk.StandardOperationStore {
102102
return ho.hr.GetMethod()
103103
}
104104

@@ -114,7 +114,7 @@ func (ho *standardHeirarchyObjects) SetMethodSet(mSet anysdk.MethodSet) {
114114
ho.hr.SetMethodSet(mSet)
115115
}
116116

117-
func (ho *standardHeirarchyObjects) SetMethod(m anysdk.OperationStore) {
117+
func (ho *standardHeirarchyObjects) SetMethod(m anysdk.StandardOperationStore) {
118118
ho.hr.SetMethod(m)
119119
}
120120

internal/stackql/taxonomy/hierarchy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func GetHeirarchyFromStatement(
242242
prov, err := handlerCtx.GetProvider(hIDs.GetProviderStr())
243243
retVal.SetProvider(prov)
244244
viewDTO, viewExists := retVal.GetView()
245-
var meth anysdk.OperationStore
245+
var meth anysdk.StandardOperationStore
246246
var methStr string
247247
var methodErr error
248248
if methodAction == "" {
@@ -297,7 +297,7 @@ func GetHeirarchyFromStatement(
297297
return retVal, nil //nolint:staticcheck // TODO: fix this
298298
}
299299
}
300-
var method anysdk.OperationStore
300+
var method anysdk.StandardOperationStore
301301
switch node.(type) {
302302
case *sqlparser.Exec, *sqlparser.ExecSubquery:
303303
method, err = rsc.FindMethod(hIDs.GetMethodStr())

0 commit comments

Comments
 (0)