Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- BigQuery: the sidebar now shows every dataset as an expandable node, with each dataset's tables loading when you open it, instead of showing one dataset at a time behind a picker.
- OpenCode Zen as an AI provider. Add it from the provider list and paste an OpenCode key, or leave the key blank to use the free models; the model list loads automatically, covering the Claude, GPT, Gemini, and open models Zen serves. (#1400)
- Oracle Database 11g (11.1 and 11.2) now connects. Previously only 12c and later worked, so 11g servers failed with a "Server Version Not Supported" error. (#1425)
- Oracle connections can now use a SID instead of a service name. Set Connection Type to SID in the connection form and enter the SID. (#1425)
- Cmd-click a foreign key arrow to open the referenced table in a new tab instead of the current one. The right-click menu has the same Open in New Tab option. (#1421)

### Changed
Expand Down
8 changes: 6 additions & 2 deletions Plugins/OracleDriverPlugin/OracleConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ final class OracleConnectionWrapper: @unchecked Sendable {
private let password: String
private let database: String
private let serviceName: String
private let useSID: Bool
private let sslConfig: SSLConfiguration

private struct LockedState: Sendable {
Expand All @@ -140,6 +141,7 @@ final class OracleConnectionWrapper: @unchecked Sendable {
password: String,
database: String,
serviceName: String = "",
useSID: Bool = false,
sslConfig: SSLConfiguration = SSLConfiguration()
) {
self.host = host
Expand All @@ -148,18 +150,20 @@ final class OracleConnectionWrapper: @unchecked Sendable {
self.password = password
self.database = database
self.serviceName = serviceName
self.useSID = useSID
self.sslConfig = sslConfig
}

// MARK: - Connection

func connect() async throws {
let service = serviceName.isEmpty ? database : serviceName
let identifier = serviceName.isEmpty ? database : serviceName
let service: OracleServiceMethod = useSID ? .sid(identifier) : .serviceName(identifier)
let tls = try OracleSSLMapping.tls(for: sslConfig)
let config = OracleNIO.OracleConnection.Configuration(
host: host,
port: port,
service: .serviceName(service),
service: service,
username: user,
password: password,
tls: tls
Expand Down
30 changes: 27 additions & 3 deletions Plugins/OracleDriverPlugin/OraclePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,27 @@ final class OraclePlugin: NSObject, TableProPlugin, DriverPlugin, PluginDiagnost
static let iconName = "oracle-icon"
static let defaultPort = 1_521
static let additionalConnectionFields: [ConnectionField] = [
ConnectionField(id: "oracleServiceName", label: "Service Name", placeholder: "ORCL")
ConnectionField(
id: "oracleConnectionType",
label: "Connection Type",
defaultValue: "service",
fieldType: .dropdown(options: [
ConnectionField.DropdownOption(value: "service", label: "Service Name"),
ConnectionField.DropdownOption(value: "sid", label: "SID")
])
),
ConnectionField(
id: "oracleServiceName",
label: "Service Name",
placeholder: "ORCL",
visibleWhen: FieldVisibilityRule(fieldId: "oracleConnectionType", values: ["service"])
),
ConnectionField(
id: "oracleSID",
label: "SID",
placeholder: "XE",
visibleWhen: FieldVisibilityRule(fieldId: "oracleConnectionType", values: ["sid"])
)
]

// MARK: - UI/Capability Metadata
Expand Down Expand Up @@ -185,14 +205,18 @@ final class OraclePluginDriver: PluginDatabaseDriver, @unchecked Sendable {
// MARK: - Connection

func connect() async throws {
let serviceName = config.additionalFields["oracleServiceName"] ?? ""
let useSID = config.additionalFields["oracleConnectionType"] == "sid"
let identifier = useSID
? config.additionalFields["oracleSID"] ?? ""
: config.additionalFields["oracleServiceName"] ?? ""
let conn = OracleConnectionWrapper(
host: config.host,
port: config.port,
user: config.username,
password: config.password,
database: config.database,
serviceName: serviceName,
serviceName: identifier,
useSID: useSID,
sslConfig: config.ssl
)
try await conn.connect()
Expand Down
2 changes: 1 addition & 1 deletion docs/databases/oracle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The Oracle driver is available as a downloadable plugin. When you select Oracle
|-------|---------|-------|
| **Host** | `localhost` | |
| **Port** | `1521` | Listener port |
| **Service Name** | - | **Required**. Use service name not SID. Check `tnsnames.ora` if unclear. |
| **Service Name** | - | **Required**. Check `tnsnames.ora` if unclear. To connect by SID instead, set **Connection Type** to SID and enter the SID. |
| **Username** | - | Requires username/password auth (no OS auth) |

## Example Configurations
Expand Down
Loading