Skip to content

OF-3238: Add exploratory CockroachDB support#3241

Open
guusdk wants to merge 3 commits intoigniterealtime:mainfrom
guusdk:OF-3238_CockroachDB-support-introduction
Open

OF-3238: Add exploratory CockroachDB support#3241
guusdk wants to merge 3 commits intoigniterealtime:mainfrom
guusdk:OF-3238_CockroachDB-support-introduction

Conversation

@guusdk
Copy link
Copy Markdown
Member

@guusdk guusdk commented Apr 2, 2026

This is an exploratory change to evaluate whether adding CockroachDB support to Openfire is feasible.

The change adds CockroachDB database handling across schema installation, a version-38 upgrade script, setup presets, and documentation. It also adds install/upgrade CI coverage using CockroachDB in Docker.

CockroachDB support is implemented via PostgreSQL wire compatibility, using the existing PostgreSQL JDBC driver.

Copy link
Copy Markdown
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

Adds exploratory CockroachDB support to Openfire by introducing a new database type that uses PostgreSQL wire compatibility, along with schema/upgrade scripts, setup presets, documentation, and CI coverage.

Changes:

  • Add CockroachDB detection to DbConnectionManager and introduce a new DatabaseType value.
  • Add CockroachDB install + v38 upgrade SQL scripts.
  • Extend setup UI, documentation, and GitHub Actions CI to exercise CockroachDB in Docker.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
xmppserver/src/main/webapp/setup/setup-datasource-standard.jsp Adds a CockroachDB JDBC preset to the setup wizard.
xmppserver/src/main/java/org/jivesoftware/database/DbConnectionManager.java Detects CockroachDB via JDBC metadata and adds DatabaseType.cockroachdb.
documentation/database.html Documents CockroachDB usage and adds it to the database guide navigation.
distribution/src/database/openfire_cockroachdb.sql New CockroachDB schema install script (PostgreSQL-compatible).
distribution/src/database/upgrade/38/openfire_cockroachdb.sql New CockroachDB v38 upgrade script.
build/ci/updater/src/main/java/com/igniterealtime/openfire/updaterunner/Main.java Updates the internal (commented) list of example DB URLs to include CockroachDB.
build/ci/compose/cockroachdb.yml Adds a CockroachDB docker-compose definition for CI.
.github/workflows/continuous-integration-workflow.yml Adds CockroachDB install/upgrade jobs and wires them into publish prerequisites.

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

Comment thread xmppserver/src/main/webapp/setup/setup-datasource-standard.jsp Outdated
Comment thread documentation/database.html
Comment thread documentation/database.html Outdated
Comment thread .github/workflows/continuous-integration-workflow.yml
Comment thread .github/workflows/continuous-integration-workflow.yml
Comment thread .github/workflows/continuous-integration-workflow.yml Outdated
@guusdk guusdk force-pushed the OF-3238_CockroachDB-support-introduction branch 3 times, most recently from eafd257 to 1246e51 Compare April 3, 2026 13:39
This is an exploratory change to evaluate whether adding CockroachDB support to Openfire is feasible.

The change adds CockroachDB database handling across schema installation, a version-38 upgrade script, setup presets, and documentation. It also adds
install/upgrade CI coverage using CockroachDB in Docker.

CockroachDB support is implemented via PostgreSQL wire compatibility, using the existing PostgreSQL JDBC driver.
@guusdk guusdk force-pushed the OF-3238_CockroachDB-support-introduction branch from e77e02d to 65545c3 Compare April 3, 2026 14:31
@guusdk guusdk requested a review from Copilot April 3, 2026 15:14
Copy link
Copy Markdown
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 8 out of 8 changed files in this pull request and generated 2 comments.


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

Comment thread .github/workflows/continuous-integration-workflow.yml
guusdk added 2 commits April 3, 2026 17:42
…ema selection

When Openfire connects to CockroachDB through the PostgreSQL JDBC driver, database metadata can look PostgreSQL-like. In that case, Openfire could classify the database as `postgresql` and load `openfire_postgresql.sql` instead of `openfire_cockroachdb.sql`.

This change hardens detection in `DbConnectionManager` by:
- capturing JDBC URL metadata,
- preserving existing direct Cockroach string checks, and
- adding a fallback probe (`SELECT version()`) for PostgreSQL-compatible connections to detect CockroachDB reliably.

If the probe finds "cockroach" in the version string, database type is set to `cockroachdb`, ensuring Cockroach-specific install/upgrade scripts are selected.
@guusdk guusdk force-pushed the OF-3238_CockroachDB-support-introduction branch from 65545c3 to 9abd7aa Compare April 3, 2026 15:42
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.

2 participants