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
9 changes: 7 additions & 2 deletions cicd/tools/api/exported_funcs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func LoadServiceDocFromFile
func LoadServiceSubsetDocFromBytes
func MakeSuffixMapFromParameterMap
func MarshalXMLUserInput
func New
func NewAddressSpaceAnalysisPassManager
func NewAddressSpaceFormulator
func NewAddressSpaceGrammar
Expand Down Expand Up @@ -121,7 +122,10 @@ func NewParameterBinding
func NewParameterSuffixMap
func NewParameterTranslator
func NewParameters
func NewPayload
func NewPrefixedTranslator
func NewProcessor
func NewProcessorPayload
func NewProvider
func NewProviderServiceResourceAnalyzer
func NewProvidersList
Expand Down Expand Up @@ -150,6 +154,7 @@ func NewStandardMapStream
func NewStandardMapStreamCollection
func NewStandardOutputPacket
func NewStandardParamInputStrem
func NewStandardPolyHandler
func NewStandardStaticAnalyzerFactoryFactory
func NewStandardTransformerLocator
func NewStaticAnalyzer
Expand Down Expand Up @@ -217,8 +222,8 @@ func TestLocalTemplatedCompositeServiceFile
func TestLocalValidateAndParseValidProviderFile
func TestMeaningfulStreamTransform
func TestMeaningfulXMLStreamTransform
func TestMinimalODataConfig
func TestMethodLevelVariableHostRoutingFutureProofed
func TestMinimalODataConfig
func TestMonolithicCompositeServiceFile
func TestNewAddressSpace
func TestNoFallbackViewApi
Expand All @@ -229,6 +234,7 @@ func TestPersistenceSetup
func TestPlaceholder
func TestProviderPull
func TestProviderPullAndPersist
func TestQueryParamPushdownConfig
func TestRegistryArrayTopLevelResponse
func TestRegistryCanHandlePolymorphismAllOf
func TestRegistryCanHandleUnspecifiedResponseWithDefaults
Expand Down Expand Up @@ -279,7 +285,6 @@ func TestXMLMArshal
func TestXMLRequestBody
func TestXMLSchemaInterrogation
func TestXPathHandle
func TestQueryParamPushdownConfig
func TranslateServiceKeyGenericProviderToIql
func TrimSelectItemsKey
func ValidateAndParse
17 changes: 15 additions & 2 deletions cicd/tools/api/exported_interfaces.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
type ActionInsertPayload interface
type ActionInsertResult interface
type AddressSpace interface
type AddressSpaceAnalysisPassManager interface
type AddressSpaceExpander interface
type AddressSpaceExpansionConfig interface
type AddressSpaceFormulator interface
type AddressSpaceGrammar interface
type Addressable interface
type AgnosticatePayload interface
type AliasMap interface
type AnalyzedFullHierarchy interface
type AnalyzedInput interface
Expand All @@ -17,6 +20,7 @@ type AnySdkClientConfigurator interface
type AnySdkDesignation interface
type AnySdkInvocation interface
type AnySdkResponse interface
type ArmouryGenerator interface
type AssistedTransport interface
type AuthDTO interface
type AuthUtility interface
Expand Down Expand Up @@ -52,14 +56,18 @@ type HttpPreparatorStream interface
type IDiscoveryAdapter interface
type IDiscoveryStore interface
type ITable interface
type InsertPreparator interface
type Interrogator interface
type Invoker interface
type ItemisationResult interface
type LateTranslator interface
type Manager interface
type MapReader interface
type MapStream interface
type MapStreamCollection interface
type MapWriter interface
type MarshalledBody interface
type MessageHandler interface
type MethodAggregateStaticAnalyzer interface
type MethodAnalysisInput interface
type MethodAnalysisOutput interface
Expand All @@ -71,14 +79,15 @@ type ObjectWithLineage interface
type ObjectWithLineageCollection interface
type ObjectWithLineageCollectionConfig interface
type ObjectWithoutLineage interface
type OrderByPushdown interface
type OpenAPIService interface
type OperationInverse interface
type OperationSelector interface
type OperationStore interface
type OperationTokens interface
type OrderByPushdown interface
type OutputPacket interface
type Pagination interface
type PagingState interface
type ParamInputStrem interface
type ParamPair interface
type ParameterBinding interface
Expand All @@ -87,7 +96,11 @@ type ParameterisedURL interface
type Params interface
type PathResolver interface
type PersistenceSystem interface
type PolyHandler interface
type ProcessedOperationResponse interface
type Processor interface
type ProcessorPayload interface
type ProcessorResponse interface
type Provider interface
type ProviderService interface
type ProviderServiceResourceAnalyzer interface
Expand All @@ -109,8 +122,8 @@ type SQLEngine interface
type SQLExternalColumn interface
type SQLExternalConnection interface
type SQLExternalTable interface
type SelectPushdown interface
type Schema interface
type SelectPushdown interface
type Service interface
type SessionContext interface
type StackQLConfig interface
Expand Down
3 changes: 3 additions & 0 deletions cicd/tools/api/exported_structs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type DropDoubleUnderscoreParamsTranslator struct
type GCCfg struct
type GetQueryToPostFormEncodedTranslator struct
type IHTTPElement struct
type Invoker struct
type JSONPathResolver struct
type KStoreCfg struct
type KeyVal struct
Expand All @@ -29,8 +30,10 @@ type ProviderInfo struct
type ProvidersList struct
type Registry struct
type RegistryConfig struct
type Request struct
type ResourcesRef struct
type ResponseKeys struct
type Result struct
type Router struct
type RuntimeCtx struct
type SQLBackendCfg struct
Expand Down
49 changes: 49 additions & 0 deletions pkg/providerinvoker/providerinvoker.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package providerinvoker

import (
"context"
)

// Request carries an invoker-specific payload. Step 1 keeps this opaque so we can
// stabilise call-shapes in StackQL before lift/shift into any-sdk.
type Request struct {
Payload any
}

// Result is a protocol-agnostic execution result from StackQL's point of view.
type Result struct {
Body any
Messages []string
}

type Invoker interface {
Invoke(ctx context.Context, req Request) (Result, error)
}

type ActionInsertPayload interface {
GetItemisationResult() ItemisationResult
IsHousekeepingDone() bool
GetTableName() string
GetParamsUsed() map[string]interface{}
GetReqEncoding() string
}

type ItemisationResult interface {
GetItems() (interface{}, bool)
GetSingltetonResponse() (map[string]interface{}, bool)
IsOk() bool
IsNilPayload() bool
}

type ActionInsertResult interface {
GetError() (error, bool)
IsHousekeepingDone() bool
}

type InsertPreparator interface {
ActionInsertPreparation(payload ActionInsertPayload) ActionInsertResult
}

type MessageHandler interface {
LogHTTPResponseMap(any)
}
83 changes: 83 additions & 0 deletions public/formulation/formulation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package formulation

import (
"github.com/stackql/any-sdk/anysdk"
"github.com/stackql/stackql-parser/go/sqltypes"
"github.com/stackql/stackql-parser/go/vt/sqlparser"
)

type ArmouryGenerator interface {
GetHTTPArmoury() (anysdk.HTTPArmoury, error)
}

type Addressable interface {
ConditionIsValid(lhs string, rhs interface{}) bool
GetLocation() string
GetName() string
GetAlias() string
GetSchema() (anysdk.Schema, bool)
GetType() string
IsRequired() bool
}

type ITable interface {
GetName() string
KeyExists(string) bool
GetKey(string) (interface{}, error)
GetKeyAsSqlVal(string) (sqltypes.Value, error)
GetRequiredParameters() map[string]Addressable
FilterBy(func(interface{}) (ITable, error)) (ITable, error)
}

type ColumnDescriptor interface {
GetAlias() string
GetDecoratedCol() string
GetIdentifier() string
GetName() string
GetNode() sqlparser.SQLNode
GetQualifier() string
GetRepresentativeSchema() anysdk.Schema
GetSchema() anysdk.Schema
GetVal() *sqlparser.SQLVal
setName(string)
}

func NewColumnDescriptor(alias string, name string, qualifier string, decoratedCol string, node sqlparser.SQLNode, schema anysdk.Schema, val *sqlparser.SQLVal) ColumnDescriptor {
rv := anysdk.NewColumnDescriptor(alias, name, qualifier, decoratedCol, node, schema, val)
return rv.(ColumnDescriptor)
}

type SQLExternalColumn interface {
GetName() string
GetType() string
GetOid() uint32
GetWidth() int
GetPrecision() int
}

func NewMethodAnalysisInput(
method anysdk.OperationStore,
service anysdk.Service,
isNilResponseAllowed bool,
columns []ColumnDescriptor,
isAwait bool,
) anysdk.MethodAnalysisInput {
cols := make([]anysdk.ColumnDescriptor, len(columns))
for i, c := range columns {
cols[i] = c.(anysdk.ColumnDescriptor)
}
return anysdk.NewMethodAnalysisInput(
method,
service,
isNilResponseAllowed,
cols,
isAwait,
)
}

type SQLExternalTable interface {
GetCatalogName() string
GetSchemaName() string
GetName() string
GetColumns() []SQLExternalColumn
}
Loading
Loading