updated aws_policy_equal function#621
Merged
general-kroll-4-life merged 11 commits intomainfrom Mar 12, 2026
Merged
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
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.
Description
Adds a new SQLite extension function
aws_policy_equal(policy1, policy2)to the StackQL embedded SQL backend. The function performs semantic comparison of AWS IAM policy JSON documents and AWS tags arrays, returning1if they are equivalent and0otherwise.Key behaviours:
Action,NotAction,Resource,NotResource,Principal,NotPrincipal,AWS,Service,Tags, andtagsfields as unordered sets — element order is ignored when comparing.Actionexpressed as either a JSON string or array ("s3:GetObject"vs["s3:GetObject"]) transparently.This is implemented in
sqlite3-binding.cas a registered custom SQLite extension (sqlite3_awspolicyequal_init), consistent with other StackQL extension functions (json_equal,split_part,regexp, etc.).Type of change
Issues referenced
Evidence
The function correctly handles the following cases (verified via inline test queries):
Checklist:
Variations
Robot tests for
aws_policy_equalare not yet included in this PR. The function is a net-new addition with no changes to existing behaviour, so regression risk is minimal. Follow-up robot test coverage should be tracked as a separate issue.Tech Debt
No technical debt results from this change. The implementation follows the established pattern for StackQL custom SQLite extensions (consistent with
json_equal,split_part, etc.) and introduces no workarounds or deferred work beyond the robot test coverage noted above.