Skip to content

Conversation

@nakamura-to
Copy link
Member

Summary

  • Added automatic inference of dialectName and driverClassName for Testcontainers JDBC URLs
  • Enhanced the regex pattern in JdbcUtil to handle URLs starting with jdbc:tc:
  • Added comprehensive tests for all supported database types

Motivation

When using Testcontainers for integration testing, users currently need to manually specify both the JDBC URL and the dialect/driver configuration. This PR improves the developer experience by automatically inferring these values from Testcontainers URLs.

Changes

  • Updated jdbcUrlPattern regex to optionally match the tc: prefix in JDBC URLs
  • Added test cases for all supported databases (PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, DB2)

Test plan

  • Added unit tests for Testcontainers URL inference
  • All existing tests pass
  • Code formatted with ./gradlew spotlessApply

Example usage:

domaCodeGen {
    url = "jdbc:tc:postgresql:13:///test"
    // dialectName and driverClassName are now automatically inferred\!
}

🤖 Generated with Claude Code

Enhanced JdbcUtil to automatically infer dialectName and driverClassName
from Testcontainers JDBC URLs (jdbc:tc:database_type:...).

This allows users to use Testcontainers URLs without manually specifying
the dialect and driver class, improving the developer experience when
working with integration tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@nakamura-to nakamura-to merged commit 3ad2e37 into master Jun 25, 2025
2 checks passed
@nakamura-to nakamura-to deleted the feat/testcontainers branch June 25, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants