Repository navigation
Description
Problem
TablePro Mobile ships six drivers covering eight database types: SQLite, DuckDB, MySQL, MariaDB, PostgreSQL, Redshift, Redis, SQL Server (IOSDriverFactory.supportedTypes() and DatabaseType.mobileSupportedTypes). Oracle is macOS only.
So an Oracle connection synced from the Mac cannot be opened on iPhone or iPad. It is not in the connection type picker either, so it cannot be created on device. Opening one falls through IOSDriverFactory.createDriver to ConnectionError.driverNotFound. The Oracle icon is already bundled in both TableProMobile/Assets.xcassets and TableProWidget/Assets.xcassets, and DatabaseTypeStyle already maps "Oracle", so the type shows up in the UI with no way to connect.
Why Oracle is the cheapest one to add
The macOS Oracle driver is pure Swift on the TableProApp/oracle-nio fork. No Instant Client, no OCI, no C bridge, nothing to build into Libs/ios. The fork (pinned at 23c7781) already declares .iOS(.v16) and TablePro Mobile deploys to iOS 18.0, so it builds for the simulator and device as-is.
This is unlike MSSQL, which needed a FreeTDS xcframework before it could ship on iOS.
Proposed solution
Follow the TableProMSSQLCore precedent: extract the engine logic into a shared module, keep the platform driver thin.
- New
TableProOracleCoremodule inPackages/TableProCore(alongsideTableProMSSQLCore,TableProTrinoCore,TableProTeradataCore), depending on theoracle-niofork. - Move the engine logic out of
Plugins/OracleDriverPlugin/(2,247 lines acrossOracleConnection.swift,OraclePlugin.swift,OracleCellFormatting.swift,OracleSSLMapping.swift,OracleListenerRefusal.swift) into that module, so the Mac plugin and the iOS driver share one implementation instead of two that drift. TableProMobile/TableProMobile/Drivers/OracleDriver.swiftconforming toTableProDatabase.DatabaseDriver, shaped likeMSSQLDriver.swift.- Register it in
IOSDriverFactory.createDriver(for:password:)andsupportedTypes(). DatabaseType+Mobile.swift: add.oracletomobileSupportedTypes,"Oracle"tomobileDisplayName,1521todefaultPort.- Connection form: Oracle needs the service name vs SID choice, which lives in
additionalFields.ConnectionFormViewhas noadditionalFieldsUI today, so this needs new fields. Without it, an imported Mac connection keeps its setting but a connection created on device cannot pick SID. - Tests in
TableProMobileTests/Drivers/next toMSSQLDriverTestsandDuckDBDriverTests, plus pure-logic tests for the extracted module. - Update
docs/databases/oracle.mdxwith what works on mobile.
Open questions
- Dependency weight.
Packages/TableProCorehas zero remote SPM dependencies right now. Addingoracle-niopulls swift-nio, swift-nio-ssl, swift-crypto, swift-collections, swift-atomics, BigInt and swift-syntax into every consumer of the package, including the widget extension. A separate local package that only the app and mobile targets link may be the better shape. Worth measuring the effect on widget launch and binary size before committing to putting it inTableProCore. - Extraction scope. Full extraction of all five files, or start with
OracleConnection.swiftplus the formatting and SSL helpers and leave the plugin-facing surface inOraclePlugin.swift. - Verification targets. Which Oracle versions to test against on device. Native network encryption negotiation (Oracle connection fails with uncleanShutdown on non-TLS server #483, 连接Oracle闪退 #1746) is the same code path, so 11g needs a real run, not just a simulator smoke test.
Alternatives considered
- Ship Oracle on iOS as a plugin. Not possible: iOS has no plugin loading, drivers are compiled into the app.
- Duplicate the driver in
TableProMobile/Drivers/without extracting a shared module. Rejected: two copies of 2,000+ lines of protocol handling that will drift on the next Oracle fix.
Activity
feat(ios): Oracle support in TablePro Mobile (#2034)