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 OraClientConfigurationClientConfiguration with a typed driverOptions: { direct?: boolean }. Unless driverOptions.direct is true, attempts to locate and initialize a native Oracle Client library (for Thick mode) before connecting. 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.

See also