Skip to content

Conversation

@devhawk
Copy link
Collaborator

@devhawk devhawk commented Jan 15, 2026

DBOS uses HikariDataSource if a data source is not provided. This PR updated sysdb + dbos config to support base DataSource (i.e. non Hikari data sources)

Also added DBOS.registerQueues to register more than one queue at a time

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for plain DataSource interfaces instead of requiring HikariDataSource throughout the codebase. The change enables using any JDBC DataSource implementation, such as PGSimpleDataSource, while maintaining backward compatibility with Hikari-specific features when a HikariDataSource is provided.

Changes:

  • Updated all DAO classes and SystemDatabase to use the generic DataSource interface instead of HikariDataSource
  • Removed redundant isClosed() checks that are specific to HikariDataSource
  • Added runtime type checks to conditionally access Hikari-specific features like pool management
  • Updated DBOSConfig to accept any DataSource implementation
  • Added test coverage for using PGSimpleDataSource alongside existing HikariDataSource tests

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
transact/src/main/java/dev/dbos/transact/config/DBOSConfig.java Changed dataSource field and withDataSource method to use generic DataSource interface
transact/src/main/java/dev/dbos/transact/database/SystemDatabase.java Updated to use DataSource interface, added conditional casting for Hikari-specific operations
transact/src/main/java/dev/dbos/transact/database/WorkflowDAO.java Changed to use DataSource and removed HikariDataSource-specific isClosed() checks
transact/src/main/java/dev/dbos/transact/database/StepsDAO.java Updated to use DataSource interface and removed isClosed() checks
transact/src/main/java/dev/dbos/transact/database/QueuesDAO.java Changed to use DataSource and removed isClosed() checks
transact/src/main/java/dev/dbos/transact/database/NotificationsDAO.java Updated to use DataSource interface and removed isClosed() checks
transact/src/main/java/dev/dbos/transact/migrations/MigrationManager.java Changed runMigrations method parameter to accept generic DataSource
transact/src/test/java/dev/dbos/transact/database/DBTestAccess.java Updated return type to Optional to handle non-Hikari data sources
transact/src/test/java/dev/dbos/transact/config/ConfigTest.java Added new test for PGSimpleDataSource and updated existing test to handle Optional

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devhawk devhawk requested a review from Copilot January 15, 2026 23:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chuck-dbos
Copy link
Contributor

Does this fix #136?

@devhawk
Copy link
Collaborator Author

devhawk commented Jan 20, 2026

Does this fix #136?

Not really. I mean if you provide a non Hikari data source, then you won't get Hikari data source logs, but otherwise doesn't change anything related to logging

@devhawk devhawk merged commit cc4cc7e into main Jan 20, 2026
21 checks passed
@devhawk devhawk deleted the devhawk/generic-data-source branch January 20, 2026 20:20
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