Skip to main content

OraAdapter

OraAdapter is the Adapter implementation shipped by @sqb/oracle, connecting to Oracle Database via oracledb. It self-registers with AdapterRegistry as a side effect of importing @sqb/oracle — see the Oracle adapter guide for setup, connection-string resolution, and Thin/Thick mode selection.

import '@sqb/oracle';

Constructor​

new OraAdapter()

Takes no arguments. You normally never construct this directly — importing @sqb/oracle registers a shared instance with AdapterRegistry for you.

Properties​

PropertyTypeDescription
driver'oracledb'The driver name, matched against ClientConfiguration.driver.
dialect'oracle'The dialect name, matched against ClientConfiguration.dialect.
featuresAdapter.Features{ cursor: true, schema: true }.

Methods​

connect()​

connect(config: OraClientConfiguration): Promise<Adapter.Connection>

Accepts an OraClientConfiguration — ClientConfiguration with a typed driverOptions: { direct?: boolean }. The native Oracle Client lookup (for Thick mode) happens once when @sqb/oracle is imported, not per connection (since v6.0.10); driverOptions.direct is still accepted but no longer affects it — see Thin vs. Thick mode. Builds an oracledb connectString from config.host/.port/.database (host may itself be a full user:password@host:port/database URL), opens the connection via oracledb.getConnection(), retrieves the session's Oracle SID, and sets the initial schema if config.schema is given. Returns an OraConnection wrapping the opened connection, closing it and rethrowing if any of this fails. The connection's serverVersion (passed to the dialect as dialectVersion) is the dotted oracleServerVersionString (e.g. "19.3.0.0.0"), so @sqb/oracle-dialect's >= 12 pagination check sees the real major version.

Other exports​

ExportDescription
versionThis package's own version string (e.g. "6.3.0"), kept in step with package.json.
OraConnection, OraCursorThe Adapter.Connection/Adapter.Cursor implementations connect() returns.

See also​