Add :sid and :service_name connection options#289
Merged
yahonda merged 1 commit intorsim:masterfrom May 8, 2026
Merged
Conversation
9f97b95 to
e04391d
Compare
Match the oracle-enhanced adapter (rsim/oracle-enhanced#2669) by introducing explicit `:service_name` and `:sid` aliases for `:database`. The three keys are mutually exclusive — supplying more than one raises ArgumentError. `:service_name` builds the EZCONNECT (service-name) URL; `:sid` builds the legacy SID URL on JDBC and an inline TNS connect descriptor on OCI, so SID-based connections now work under the OCI driver too. The `database: ":SID"` colon-prefix overload still works but is deprecated and emits a warning pointing at `:sid`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e04391d to
d13043c
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.
Summary
:service_nameand:sidconnection options on top of the existing:database, mirroring rsim/oracle-enhanced#2669 so the two gems share the same configuration shape.ArgumentError.:service_namerejects/-prefixed values;:sidis validated against\A[\w$#]+\z.:sidbuildsjdbc:oracle:thin:@host:port:SIDon JDBC and an inline TNS connect descriptor(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=...)(PORT=...))(CONNECT_DATA=(SID=...)))on OCI, closing the OCI gap (previously SID-based connections required a hand-built TNS string).database: ":SID"colon-prefix overload still works but is deprecated and emits aKernel.warnpointing at:sid.Test plan
DATABASE_USER=hr DATABASE_PASSWORD=hr DATABASE_USER2=arunit DATABASE_PASSWORD2=arunit bundle exec rspec spec/plsql/connection_spec.rb— 47 examples, 0 failuressid:andservice_name:connect against an XE / 23ai instance respectivelydatabase: ":XE"🤖 Generated with Claude Code