OF-3238: Add exploratory CockroachDB support#3241
Open
guusdk wants to merge 3 commits intoigniterealtime:mainfrom
Open
OF-3238: Add exploratory CockroachDB support#3241guusdk wants to merge 3 commits intoigniterealtime:mainfrom
guusdk wants to merge 3 commits intoigniterealtime:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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
DbConnectionManagerand introduce a newDatabaseTypevalue. - 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.
eafd257 to
1246e51
Compare
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.
e77e02d to
65545c3
Compare
Contributor
There was a problem hiding this comment.
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.
…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.
65545c3 to
9abd7aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.