OXY-161: Productionize oxygen-sql JDBC connection params - #306
Merged
Conversation
Kalin-Rudnicki
commented
Aug 15, 2026
…me, extra props) Add a typed, optional `DbConfig.Connection` block (SSL mode, cert/key paths, connect/socket timeouts, application name, and a `Map[String,String]` escape hatch) and wire it through `Driver`/`JdbcDriver` into the JDBC connection `Properties` alongside user/password. - `DbConfig.SslMode` enum encodes/decodes the Postgres `sslmode` spellings (disable/allow/prefer/require/verify-ca/verify-full). - `JdbcDriver.buildProperties` assembles props (credentials -> typed -> extra; extra applied last, so the escape hatch wins on collision). - All fields optional; `Connection.default` is empty and preserves current behavior when unset, so `connection` can be omitted from config JSON. - Unit tests for SslMode encode/decode, Connection.properties, buildProperties, and JSON decoding. Docs updated in sql/database.md. Closes OXY-161. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011YxWKdsz97QT9BD7AdpSq6
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011YxWKdsz97QT9BD7AdpSq6
Per review: the report belongs on the OXY-161 issue, not in-repo. Moved verbatim to a comment on OXY-161 and deleted the file. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Kalin-Rudnicki
force-pushed
the
OXY-161
branch
from
August 15, 2026 17:16
a4fd212 to
140e675
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.
OXY-161 — Productionize oxygen-sql JDBC params
Today
JdbcDriveronly ever putuser/passwordinto the JDBCProperties, so SSL mode, timeouts, application name, and other connection knobs were inexpressible ("ssl prefer"was impossible without hand-editing the URL). This makes JDBC connection params first-class/typed onDbConfig.What changed
DbConfig.Connection— new optional, typed block:sslMode: Option[SslMode](Postgressslmode:disable,allow,prefer,require,verify-ca,verify-full)sslRootCert/sslCert/sslKey(cert/key file paths)connectTimeout/socketTimeout(Duration, sent as whole seconds)applicationNameextraProperties: Map[String, String]— escape hatch, copied verbatimDriver/JdbcDriver—getConnectiontakes theConnection; new testableJdbcDriver.buildPropertiesassembles theProperties(credentials → typed →extraProperties; extra applied last so the escape hatch wins on collision).GetConnection.layerreadsDbConfig.Connection;Database.make/layerthread it through.Connection.defaultis empty, andconnectioncan be omitted from config JSON entirely.docs/docs/sql/database.mddocuments the block + property mapping.Design notes
pgjdbc) flavored per the ticket analysis; the dialect seam is deferred to OXY-159/160.SslModeuses the exact libpq spellings, decoded case-insensitively.@jsonSecretonConnection— it carries only paths/timeouts/names (no secret material);sslpasswordintentionally left toextraProperties.Tests
DbConfigSpec(11 tests, unit-level, no live DB): SslMode encode/decode,Connection.propertiestranslation,buildProperties(incl. escape-hatch override), and JSON decoding ofConnection+ fullDbConfig.oxygen-sql/oxygen-sql-test/sql-itcompile green;sbt fmtclean.🤖 Generated with Claude Code
https://claude.ai/code/session_011YxWKdsz97QT9BD7AdpSq6