Skip to content

Add Flyway database plugin for Aurora DSQL#1

Merged
amaksimo merged 9 commits intomainfrom
feature/java-flyway-adapter
Jan 27, 2026
Merged

Add Flyway database plugin for Aurora DSQL#1
amaksimo merged 9 commits intomainfrom
feature/java-flyway-adapter

Conversation

@amaksimo
Copy link
Copy Markdown
Contributor

Summary

Adds Java/Flyway adapter to the monorepo - the first Java adapter.

What's Included

Implementation (5 classes)

  • AuroraDSQLDatabaseType - URL detection, driver class, priority
  • AuroraDSQLDatabase - DDL transaction handling, schema history table
  • AuroraDSQLConnection - SET ROLE bypass, advisory lock bypass
  • AuroraDSQLSchema - Custom doClean() that drops views before tables
  • AuroraDSQLTable - FOR UPDATE bypass

Tests

  • 25 unit tests
  • 11 integration tests against live DSQL cluster

CI/CD

  • java-flyway-ci.yml - Build, unit test, integration test with DSQL cluster
  • java-flyway-release.yml - Release workflow (Maven Central publishing TBD)

DSQL Compatibility

The plugin handles these DSQL-specific behaviors:

  • SET ROLE not supported (DSQL uses IAM authentication)
  • Advisory locks not supported (DSQL uses OCC)
  • One DDL statement per transaction
  • FOR UPDATE requires equality predicates on key
  • Views must be dropped before tables in clean

Testing

Unit tests pass locally. Integration tests verified against DSQL cluster aftp56tv4kdk4ld7qyakksrlu4.dsql.us-east-1.on.aws.

Next Steps

  • Maven Central publishing configuration (GPG keys, Sonatype credentials, pom.xml metadata)

Adds Java/Flyway adapter to the monorepo with:

- Flyway plugin that extends PostgreSQL support for DSQL compatibility
- Handles SET ROLE bypass (DSQL uses IAM authentication)
- Handles advisory lock bypass (DSQL uses OCC)
- Handles one-DDL-per-transaction requirement
- Handles FOR UPDATE restrictions
- Custom doClean() that drops views before tables

Includes:
- 5 implementation classes
- 25 unit tests
- 11 integration tests
- CI workflow with DSQL cluster creation
- Release workflow (Maven Central publishing TBD)
- Reframe 'Writing DSQL-Compatible Migrations' to focus on recommended
  patterns rather than listing unsupported operations
- Simplify Docker example to be more practical and easier to understand
- Add link to Aurora DSQL documentation for comprehensive feature info
- Trim verbose Javadocs to essential information
- Remove duplicate V8 migration (view created by repeatable R__)
- Rename V9 to V8 for sequential numbering
- Add OCC troubleshooting section to README
- Update test comments to reflect migration changes
@amaksimo amaksimo force-pushed the feature/java-flyway-adapter branch from f13a16b to 4acaf18 Compare January 27, 2026 01:14
- Add unit tests for AuroraDSQLConnection, AuroraDSQLSchema, AuroraDSQLTable
- Improve exception handling in AuroraDSQLConnection.lock()
- Use PreparedStatement in integration test to prevent SQL injection
- Add exponential backoff for async index polling in integration test
- Use compiler release flag instead of source/target in pom.xml
Comment thread java/flyway/README.md Outdated
Comment thread .github/workflows/java-flyway-ci.yml Outdated
Comment thread java/flyway/README.md Outdated
Comment thread java/flyway/src/main/java/software/amazon/dsql/flyway/AuroraDSQLDatabaseType.java Outdated
- Upgrade from JDK 17 to JDK 21 across CI, release workflows, and pom.xml
- Simplify URL detection to support PrivateLink endpoints (remove .on.aws requirement)
- Remove OCC conflict troubleshooting section (not realistic for single-threaded Flyway)
- Add unit test for PrivateLink endpoint URLs
@amaksimo amaksimo requested a review from a team as a code owner January 27, 2026 20:29
Comment thread java/flyway/src/main/java/software/amazon/dsql/flyway/AuroraDSQLDatabaseType.java Outdated
@amaksimo amaksimo merged commit 9dd26e7 into main Jan 27, 2026
7 checks passed
amaksimo pushed a commit that referenced this pull request Jan 28, 2026
Initial commit for DBeaver Plugin
@danielfrankcom danielfrankcom deleted the feature/java-flyway-adapter branch February 5, 2026 00:36
amaksimo added a commit that referenced this pull request Apr 27, 2026
- Add back examples in migrate help text (pkale comment #1)
- Restructure stderr/exitCode logic: always print stderr for diagnostics,
  gate failure on exitCode in both handleMigrate and handleTransform
  (pkale comments #2, #3, #4)
- Add CLI integration tests for unfixable SQL (DROP CONSTRAINT),
  fixable SQL (FK + index), and prisma migrate diff pipe workflow
  (pkale comment #6)
- Remove VARCHAR(30) assertion from workflow test (pkale comment #7)
- Remove false claim about prebuilt binaries in README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants