Repository navigation
chore: ship the KMS trigger SQL with the gem and stamp its version - #218
Merged
Merged
Conversation
Move the KMS Encryption Plugin's PostgreSQL and MySQL trigger SQL from the integration test resources to lib/aws_advanced_ruby_driver_wrapper/plugins/ kms_encryption/sql/, so the published SQL has one source the docs can link to and users get it with the gem. The integration triggers spec now reads the files from there. Each file now records its version in a database comment (PostgreSQL v2 on enforce_encrypted_column, MySQL v1 on validate_encrypted_data_hmac_before_insert), so users can check which version is installed and whether to re-run it.
5 tasks done
sophia-bq
approved these changes
Oct 21, 2026
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.
Summary
Ship the KMS Encryption Plugin's trigger SQL with the gem and record its version in the database
Description
spec/integration/host/src/test/resources/sql/tolib/aws_advanced_ruby_driver_wrapper/plugins/kms_encryption/sql/(trigger_pg.sql,trigger_mysql.sql).lib/.COMMENT ON FUNCTION enforce_encrypted_column(), versionv2.COMMENTonvalidate_encrypted_data_hmac_before_insert, versionv1(the MySQL SQL is otherwise unchanged).kms_encryption_triggers_spec.rbnow reads the SQL from the new location.lib/is already mounted into the integration container, so no container changes were needed.Companion docs PR:
docs/kms-trigger-sql-sourcein aws-advanced-wrapper-docs links to these files. Merge this PR first, or the doc links won't resolve.Testing:
rubocopon the spec: no offenses.gem buildand confirmed both SQL files are in the package.v2andv1).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.