-
Notifications
You must be signed in to change notification settings - Fork 1
Add x-stackQL-config queryParamPushdown for OData and custom API predicate pushdown
#58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
jeffreyaven
wants to merge
11
commits into
main
from
claude/add-odata-config-option-01TFLCZJNDDC2ZhhusydBXTG
Closed
Add x-stackQL-config queryParamPushdown for OData and custom API predicate pushdown
#58
jeffreyaven
wants to merge
11
commits into
main
from
claude/add-odata-config-option-01TFLCZJNDDC2ZhhusydBXTG
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…te pushdown This adds support for configuring SQL clause pushdown to API query parameters, enabling providers to specify which SQL operations (SELECT columns, WHERE filters, ORDER BY, LIMIT, COUNT) can be translated to native API query parameters. Features: - Support for OData dialect with sensible defaults ($filter, $select, $orderby, $top, $count) - Support for custom API dialects with configurable parameter names and syntax - Per-clause configuration (select, filter, orderBy, top, count) - Supported operators and columns lists for fine-grained control - Hierarchical config at provider/service/resource/operation levels New files: - anysdk/query_param_pushdown.go: Core types and interfaces - anysdk/query_param_pushdown_test.go: Unit tests Updated: - anysdk/config.go: Added GetQueryParamPushdown to StackQLConfig interface - .claude/skills/stackql-provider-development.md: Added documentation - cicd/tools/api/exported_funcs.txt: Added GetTestingQueryParamPushdown
- Add cloudpricing provider with Azure Retail Prices API spec to test/registry/unsigned-src/ for testing queryParamPushdown config - Add TestQueryParamPushdownConfig test that validates: - OData filter config with supported operators and columns - OData select config - OData orderBy config with supported columns - Proper handling of unconfigured options (top, count) - Add test function to exported_funcs.txt
Azure Retail Prices API only supports: - $filter with 'eq' operator only - Filterable columns: armRegionName, location, meterId, meterName, productId, skuId, productName, skuName, serviceName, serviceId, serviceFamily, priceType, armSkuName Does NOT support: $select, $orderby, $top, $count Updated test assertions accordingly.
Switch to OData TripPin reference service for testing queryParamPushdown configuration. TripPin provides full OData support including $filter, $select, $orderby, $top, and $count, making it ideal for comprehensive testing. Changes: - Remove cloudpricing test provider (limited to $filter only) - Add odata_trippin provider with three resources demonstrating different pushdown configurations - Update registry_test.go with comprehensive TripPin assertions - Update skill documentation with TripPin example
Add new exported interfaces and test functions to API snapshot files: - CountPushdown, FilterPushdown, OrderByPushdown, QueryParamPushdown, SelectPushdown, TopPushdown interfaces - Test functions for pushdown configuration validation Document new API additions in docs/future_api.md per CI requirements.
The test was using 'ok' variable for both FindMethod (which returns error) and GetQueryParamPushdown (which returns bool). Go's variable shadowing with := caused type conflicts when the same variable name was reused across different return types. Fix by using unique variable names: - methodErr for FindMethod error returns - qppExists, filterExists, etc. for bool returns from pushdown getters
The path /People('{UserName}') uses OData parentheses notation which
is not supported by the OpenAPI path parser. Remove this path and its
resource references since the queryParamPushdown test only needs the
list endpoints.
The StackQLConfig field in standardOpenAPIOperationStore expects the config to be at the method level, not the resource level. This moves the queryParamPushdown configuration from each resource's config block into the methods.list.config block where it will be properly parsed.
- Create docs/provider_spec.md: comprehensive provider anatomy documentation covering hierarchy, config options, SQL verb mapping, inheritance, and all OpenAPI extensions - Update skill file to clarify that queryParamPushdown must be at method level (no inheritance from resource/service/provider levels) - Fix OData example in skill to show config at method level
Implement inheritance for queryParamPushdown configuration, following the same pattern as other config options (pagination, requestTranslate, etc.): Method → Resource → Service → ProviderService → Provider Changes: - Add GetQueryParamPushdown() to OperationStore interface with inheritance - Add GetQueryParamPushdown() to Provider, ProviderService, Resource interfaces - Add getQueryParamPushdown() to OpenAPIService interface - Update test provider to demonstrate all three inheritance levels: - Service-level: airlines (inherits from x-stackQL-config) - Resource-level: people (overrides service-level) - Method-level: airports (overrides service-level) - Update skill file and provider_spec.md documentation This enables setting a default OData config at the service level for providers like EntraID, avoiding repetitive config at every method level.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
queryParamPushdownconfiguration option tox-stackQL-configenabling SQL clause pushdown to API query parametersSupports OData dialect with sensible defaults and custom API dialects for flexible integration
Configuration can be set at provider, service, resource, or method level with lower-level config overriding higher-level
Supported Pushdown Options
$select- Column projection (SELECT clause)$filter- Row filtering (WHERE clause) with supportedOperators and supportedColumns$orderby- Ordering (ORDER BY clause)$top- Row limit (LIMIT clause) with optional maxValue cap$count- Count support (SELECT COUNT(*))Test plan