Skip to content

Add DatabaseConfig DSL with Transactor and HikariCP pooling support - #180

Merged
oyvindberg merged 2 commits into
mainfrom
data-source
Jan 4, 2026
Merged

Add DatabaseConfig DSL with Transactor and HikariCP pooling support#180
oyvindberg merged 2 commits into
mainfrom
data-source

Conversation

@oyvindberg

Copy link
Copy Markdown
Collaborator

Summary

  • Add foundations-jdbc-hikari module with HikariCP 6.2.1 connection pooling
  • Add typed DatabaseConfig classes per database (PostgresConfig, MariaDbConfig, DuckDbConfig, OracleConfig, SqlServerConfig, Db2Config) with connect() method
  • Add PoolConfig for HikariCP pool settings with builder pattern
  • Add PooledDataSource wrapper with transactor() convenience method
  • Add DatabaseKind enum for database type detection
  • Add SqlSupplier<T> functional interface that can throw SQLException
  • Change Transactor to use SqlSupplier<Connection> for cleaner exception handling
  • Add Transactor(DatabaseConfig, Strategy) constructor for direct config usage
  • Add Transactor.testStrategy() for test isolation (always rollback)
  • Fix UpdateBuilder.where() and DeleteBuilder.where() to accept Scala SqlExpr
  • Update typr.TypoDataSource to use new DatabaseConfig classes
  • Update all tester WithConnection files to use new Transactor API

Test plan

  • All existing tests pass
  • Verified compilation for Java, Kotlin, and Scala testers
  • Tested with PostgreSQL, MariaDB, DuckDB testers

🤖 Generated with Claude Code

New modules and APIs:
- foundations-jdbc-hikari: HikariCP 6.2.1 connection pooling module
- DatabaseConfig classes per database (PostgresConfig, MariaDbConfig,
  DuckDbConfig, OracleConfig, SqlServerConfig, Db2Config) with connect() method
- PoolConfig for HikariCP pool settings with builder pattern
- PooledDataSource wrapper with transactor() convenience method
- DatabaseKind enum for database type detection
- SqlSupplier<T> functional interface that can throw SQLException

Transactor improvements:
- Change Transactor to use SqlSupplier<Connection> for cleaner exception handling
- Add Transactor(DatabaseConfig, Strategy) constructor for direct config usage
- Add Transactor.testStrategy() for test isolation (always rollback)

Other changes:
- Fix UpdateBuilder.where() and DeleteBuilder.where() to accept Scala SqlExpr
- Update typr.TypoDataSource to use new DatabaseConfig classes
- Update all tester WithConnection files to use new Transactor API

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
FREEPDB1 is a pluggable database service name, not a SID. The Oracle
test helpers were generating SID format URLs which caused ORA-12505
errors. Added .serviceName("FREEPDB1") to generate the correct service
name URL format.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@oyvindberg
oyvindberg merged commit e056721 into main Jan 4, 2026
21 of 24 checks passed
@oyvindberg
oyvindberg deleted the data-source branch January 4, 2026 13:00
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.

1 participant