UNPKG

@types/oracledb

Version:
1,056 lines (1,017 loc) 269 kB
/// <reference types="node" /> import { Duplex, Readable } from "stream"; declare namespace OracleDB { /** Deprecated */ // const ARRAY: number; // const OBJECT: number; type CSFRM_IMPLICIT = 1; type CSFRM_NCHAR = 2; /** Constant for the query result outFormat option. */ const OUT_FORMAT_ARRAY: number; /** Constant for the query result outFormat option. */ const OUT_FORMAT_OBJECT: number; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const BLOB: typeof DB_TYPE_BLOB; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const BUFFER: typeof DB_TYPE_RAW; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const CLOB: typeof DB_TYPE_CLOB; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const CURSOR: typeof DB_TYPE_CURSOR; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const DATE: typeof DB_TYPE_TIMESTAMP; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const DEFAULT: number; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const NUMBER: typeof DB_TYPE_NUMBER; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const NCLOB: typeof DB_TYPE_NCLOB; /** Constant for execute() bind parameter type property, for the createLob() type parameter, for the Lob type property, for fetchAsBuffer, for fetchAsString and fetchInfo, and for extended metadata. */ const STRING: typeof DB_TYPE_VARCHAR; class DbType { num: number; name: string; columnTypeName: string; _bufferSizeFactor: number; _oraTypeNum: number; csfrm: number; constructor( num: number, name: string, columnTypeName: string, options?: { bufferSizeFactor?: number; oraTypeNum?: number; csfrm?: number }, ); toString: () => string; } /** Constant which represents the Oracle Database type. */ const DB_TYPE_BFILE: DbType & { num: 2020; name: "DB_TYPE_BFILE"; columnTypeName: "BFILE"; oraTypeNum: 114; bufferSizeFactor: 112; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_BINARY_DOUBLE: DbType & { num: 2008; name: "DB_TYPE_BINARY_DOUBLE"; columnTypeName: "BINARY_DOUBLE"; oraTypeNum: 101; bufferSizeFactor: 8; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_BINARY_FLOAT: DbType & { num: 2007; name: "DB_TYPE_BINARY_FLOAT"; columnTypeName: "BINARY_FLOAT"; oraTypeNum: 100; bufferSizeFactor: 4; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_BINARY_INTEGER: DbType & { num: 2009; name: "DB_TYPE_BINARY_INTEGER"; columnTypeName: "BINARY_INTEGER"; oraTypeNum: 3; bufferSizeFactor: 22; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_BLOB: DbType & { num: 2019; name: "DB_TYPE_BLOB"; columnTypeName: "BLOB"; oraTypeNum: 113; bufferSizeFactor: 112; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_BOOLEAN: DbType & { num: 2022; name: "DB_TYPE_BOOLEAN"; columnTypeName: "BOOLEAN"; oraTypeNum: 252; bufferSizeFactor: 4; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_CHAR: DbType & { num: 2003; name: "DB_TYPE_CHAR"; columnTypeName: "CHAR"; oraTypeNum: 96; bufferSizeFactor: 4; csfrm: CSFRM_IMPLICIT; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_CLOB: DbType & { num: 2017; name: "DB_TYPE_CLOB"; columnTypeName: "CLOB"; oraTypeNum: 112; bufferSizeFactor: 112; csfrm: CSFRM_IMPLICIT; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_CURSOR: DbType & { num: 2021; name: "DB_TYPE_CURSOR"; columnTypeName: "CURSOR"; oraTypeNum: 102; bufferSizeFactor: 4; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_DATE: DbType & { num: 2011; name: "DB_TYPE_DATE"; columnTypeName: "DATE"; oraTypeNum: 12; bufferSizeFactor: 7; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_INTERVAL_DS: DbType & { num: 2015; name: "DB_TYPE_INTERVAL_DS"; columnTypeName: "INTERVAL DAY TO SECOND"; oraTypeNum: 183; bufferSizeFactor: 11; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_INTERVAL_YM: DbType & { num: 2016; name: "DB_TYPE_INTERVAL_YM"; columnTypeName: "INTERVAL YEAR TO MONTH"; oraTypeNum: 182; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_JSON: DbType & { num: 2027; name: "DB_TYPE_JSON"; columnTypeName: "JSON"; oraTypeNum: 119 }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_LONG: DbType & { num: 2024; name: "DB_TYPE_LONG"; columnTypeName: "LONG"; oraTypeNum: 8; csfrm: CSFRM_IMPLICIT; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_LONG_NVARCHAR: DbType & { num: 2031; name: "DB_TYPE_LONG_NVARCHAR"; columnTypeName: "LONG"; oraTypeNum: 8; csfrm: CSFRM_NCHAR; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_LONG_RAW: DbType & { num: 2025; name: "DB_TYPE_LONG_RAW"; columnTypeName: "LONG RAW"; oraTypeNum: 24; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_NCHAR: DbType & { num: 2004; name: "DB_TYPE_NCHAR"; columnTypeName: "NCHAR"; oraTypeNum: 96; bufferSizeFactor: 4; csfrm: CSFRM_NCHAR; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_NCLOB: DbType & { num: 2018; name: "DB_TYPE_NCLOB"; columnTypeName: "NCLOB"; oraTypeNum: 112; bufferSizeFactor: 112; csfrm: CSFRM_NCHAR; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_NUMBER: DbType & { num: 2010; name: "DB_TYPE_NUMBER"; columnTypeName: "NUMBER"; oraTypeNum: 2; bufferSizeFactor: 22; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_NVARCHAR: DbType & { num: 2002; name: "DB_TYPE_NVARCHAR"; columnTypeName: "NVARCHAR2"; oraTypeNum: 1; bufferSizeFactor: 4; csfrm: CSFRM_NCHAR; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_OBJECT: DbType & { num: 2023; name: "DB_TYPE_OBJECT"; columnTypeName: "OBJECT"; oraTypeNum: 109 }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_RAW: DbType & { num: 2006; name: "DB_TYPE_RAW"; columnTypeName: "RAW"; oraTypeNum: 23; bufferSizeFactor: 1; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_ROWID: DbType & { num: 2005; name: "DB_TYPE_ROWID"; columnTypeName: "ROWID"; oraTypeNum: 11; bufferSizeFactor: 18; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_TIMESTAMP: DbType & { num: 2012; name: "DB_TYPE_TIMESTAMP"; columnTypeName: "TIMESTAMP"; oraTypeNum: 180; bufferSizeFactor: 11; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_TIMESTAMP_LTZ: DbType & { num: 2014; name: "DB_TYPE_TIMESTAMP_LTZ"; columnTypeName: "TIMESTAMP WITH LOCAL TIME ZONE"; oraTypeNum: 231; bufferSizeFactor: 11; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_TIMESTAMP_TZ: DbType & { num: 2013; name: "DB_TYPE_TIMESTAMP_TZ"; columnTypeName: "TIMESTAMP WITH TIME ZONE"; oraTypeNum: 181; bufferSizeFactor: 13; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_UROWID: DbType & { num: 2030; name: "DB_TYPE_UROWID"; columnTypeName: "UROWID"; oraTypeNum: 208 }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_VARCHAR: DbType & { num: 2001; name: "DB_TYPE_VARCHAR"; columnTypeName: "VARCHAR2"; oraTypeNum: 1; bufferSizeFactor: 4; csfrm: CSFRM_IMPLICIT; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_XMLTYPE: DbType & { num: 2032; name: "DB_TYPE_XMLTYPE"; columnTypeName: "XMLTYPE"; oraTypeNum: 109; bufferSizeFactor: 2147483647; csfrm: CSFRM_IMPLICIT; }; /** Constant which represents the Oracle Database type. */ const DB_TYPE_VECTOR: DbType & { num: 2033; name: "DB_TYPE_VECTOR"; columnTypeName: "VECTOR"; oraTypeNum: 127; }; class IntervalYM { /** * It returns an object containing optional integer attributes: 'years' and 'months'.. * * @since 6.8 */ years?: number | undefined; months?: number | undefined; } class IntervalDS { /** * It returns an object containing optional integer attributes: 'days', 'hours', 'minutes', 'seconds', and 'fseconds' (fractional seconds denoted in nanoseconds). * * @since 6.8 */ days?: number | undefined; hours?: number | undefined; minutes?: number | undefined; seconds?: number | undefined; fseconds?: number | undefined; } class JsonId extends Uint8Array { /** * It returns a SODA document key '_id' in hex string. * @since 6.5.0 */ toJSON(): string; } type TypedArray = Float32Array | Float64Array | Int8Array | Uint8Array | Uint32Array; interface SparseVectorInputObject { numDimensions: number; indices: Array<number> | Uint32Array; values: Array<number> | TypedArray; } type SparseVectorType = SparseVectorInputObject | Array<number> | string | TypedArray; class SparseVector<T extends TypedArray = Float64Array> { constructor( vec?: SparseVectorType, ); /** * This property is a JavaScript array or a 32-bit unsigned integer (Uint32Array) TypedArray that specifies the indices (zero-based) of non-zero values in the vector. * * @since 6.8 */ indices?: Array<number> | Uint32Array | undefined; /** * This property is an integer that specifies the number of dimensions of the vector. * * @since 6.8 */ numDimensions?: number | undefined; /** * This property is a JavaScript array or TypedArray that specifies the non-zero values stored in the vector. * * @since 6.8 */ values?: Array<number> | TypedArray | undefined; /** * Converts a sparse vector to a dense vector and returns a TypedArray of 8-bit signed integers, 32-bit floating-point numbers, * or 64-bit floating-point numbers depending on the storage format of the sparse vector column’s non-zero values in Oracle Database. * * @since 6.8 */ dense(): T | undefined; } /** Constant for the dir property of execute() bindParams, queryStream() and executeMany() bindDefs. */ const BIND_IN: number; /** Constant for the dir property of execute() bindParams, queryStream() and executeMany() bindDefs. */ const BIND_INOUT: number; /** Constant for the dir property of execute() bindParams, queryStream() and executeMany() bindDefs. */ const BIND_OUT: number; /** Constant for getConnection() privilege properties. */ const SYSASM: number; /** Constant for getConnection() privilege properties. */ const SYSBACKUP: number; /** Constant for getConnection() privilege properties. */ const SYSDBA: number; /** Constant for getConnection() privilege properties. */ const SYSDG: number; /** Constant for getConnection() privilege properties. */ const SYSKM: number; /** Constant for getConnection() privilege properties. */ const SYSOPER: number; /** Constant for getConnection() privilege properties. */ const SYSPRELIM: number; /** Constant for getConnection() privilege properties. */ const SYSRAC: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_ALTER: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_BEGIN: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_CALL: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_COMMIT: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_CREATE: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_DECLARE: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_DELETE: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_DROP: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_EXPLAIN_PLAN: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_INSERT: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_MERGE: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_ROLLBACK: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_SELECT: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_UNKNOWN: number; /** Constant for connection.getStatementInfo() properties. */ const STMT_TYPE_UPDATE: number; /** Constant for the Continuous Query Notification message.type. */ const SUBSCR_EVENT_TYPE_AQ: number; /** Constant for the Continuous Query Notification message.type. */ const SUBSCR_EVENT_TYPE_DEREG: number; /** Constant for the Continuous Query Notification message.type. */ const SUBSCR_EVENT_TYPE_OBJ_CHANGE: number; /** Constant for the Continuous Query Notification message.type. */ const SUBSCR_EVENT_TYPE_QUERY_CHANGE: number; /** Constant for the Continuous Query Notification message.type. */ const SUBSCR_EVENT_TYPE_SHUTDOWN: number; /** Constant for the Continuous Query Notification message.type. */ const SUBSCR_EVENT_TYPE_SHUTDOWN_ANY: number; /** Constant for the Continuous Query Notification message.type. */ const SUBSCR_EVENT_TYPE_STARTUP: number; /** Constant for the Continuous Query Notification groupingClass. */ const SUBSCR_GROUPING_CLASS_TIME: number; /** Constant for the Continuous Query Notification groupingType. */ const SUBSCR_GROUPING_TYPE_LAST: number; /** Constant for the Continuous Query Notification groupingType. */ const SUBSCR_GROUPING_TYPE_SUMMARY: number; /** Constant for the Continuous Query Notification qos Quality of Service. */ const SUBSCR_QOS_BEST_EFFORT: number; /** Constant for the Continuous Query Notification qos Quality of Service. */ const SUBSCR_QOS_DEREG_NFY: number; /** Constant for the Continuous Query Notification qos Quality of Service. */ const SUBSCR_QOS_QUERY: number; /** Constant for the Continuous Query Notification qos Quality of Service. */ const SUBSCR_QOS_RELIABLE: number; /** Constant for the Continuous Query Notification qos Quality of Service. */ const SUBSCR_QOS_ROWIDS: number; /** Constant for the Continuous Query Notification namespace. */ const SUBSCR_NAMESPACE_AQ: number; /** Constant for the Continuous Query Notification namespace. */ const SUBSCR_NAMESPACE_DBCHANGE: number; /** Constant for the AqDeqOptions Class 'mode' */ const AQ_DEQ_MODE_BROWSE: number; /** Constant for the AqDeqOptions Class 'mode' */ const AQ_DEQ_MODE_LOCKED: number; /** Constant for the AqDeqOptions Class 'mode' */ const AQ_DEQ_MODE_REMOVE: number; /** Constant for the AqDeqOptions Class 'mode' */ const AQ_DEQ_MODE_REMOVE_NO_DAT: number; /** Constant for the AqDeqOptions Class 'navigation' */ const AQ_DEQ_NAV_FIRST_MSG: number; /** Constant for the AqDeqOptions Class 'navigation' */ const AQ_DEQ_NAV_NEXT_TRANSACTION: number; /** Constant for the AqDeqOptions Class 'navigation' */ const AQ_DEQ_NAV_NEXT_MSG: number; /** Constant for the AqDeqOptions Class 'wait' */ const AQ_DEQ_NO_WAIT: number; /** Constant for the AqDeqOptions Class 'wait' */ const AQ_DEQ_WAIT_FOREVER: number; /** Constant for the AqEnqOptions Class 'deliveryMode' */ const AQ_DEQ_WAAQ_MSG_DELIV_MODE_PERSISTENTIT_FOREVER: number; /** Constant for the AqEnqOptions Class 'deliveryMode' */ const AQ_MSG_DELIV_MODE_BUFFERED: number; /** Constant for the AqEnqOptions Class 'deliveryMode' */ const AQ_MSG_DELIV_MODE_PERSISTENT_OR_BUFFERED: number; /** Constant for the AqMessage Class 'state' */ const AQ_MSG_STATE_READY: number; /** Constant for the AqMessage Class 'state' */ const AQ_MSG_STATE_WAITING: number; /** Constant for the AqMessage Class 'state' */ const AQ_MSG_STATE_PROCESSED: number; /** Constant for the AqMessage Class 'state' */ const AQ_MSG_STATE_EXPIRED: number; /** Constant for the AqEnqOptions Class and AqDeqOptions 'visibility' */ const AQ_VISIBILITY_IMMEDIATE: number; /** Constant for the AqEnqOptions Class and AqDeqOptions 'visibility' */ const AQ_VISIBILITY_ON_COMMIT: number; /** Constant for the Continuous Query Notification connection.subscribe() option operations, and for the notification message operation properties. */ const CQN_OPCODE_ALL_OPS: number; /** Constant for the Continuous Query Notification connection.subscribe() option operations, and for the notification message operation properties. */ const CQN_OPCODE_ALL_ROWS: number; /** Constant for the Continuous Query Notification connection.subscribe() option operations, and for the notification message operation properties. */ const CQN_OPCODE_ALTER: number; /** Constant for the Continuous Query Notification connection.subscribe() option operations, and for the notification message operation properties. */ const CQN_OPCODE_DELETE: number; /** Constant for the Continuous Query Notification connection.subscribe() option operations, and for the notification message operation properties. */ const CQN_OPCODE_DROP: number; /** Constant for the Continuous Query Notification connection.subscribe() option operations, and for the notification message operation properties. */ const CQN_OPCODE_INSERT: number; /** Constant for the Continuous Query Notification connection.subscribe() option operations, and for the notification message operation properties. */ const CQN_OPCODE_UPDATE: number; /** Constant for the connection pool.status readonly attribute. */ const POOL_STATUS_OPEN: number; /** Constant for the connection pool.status readonly attribute. */ const POOL_STATUS_DRAINING: number; /** Constant for the connection pool.status readonly attribute. */ const POOL_STATUS_CLOSED: number; /** Constant for the sodaDatabase.createCollection() mode property. */ const SODA_COLL_MAP_MODE: number; /** Constant for shutting down the Oracle database with oracledb.shutdown() and connection.shutdown() */ const SHUTDOWN_MODE_ABORT: number; /** Constant for shutting down the Oracle database with oracledb.shutdown() and connection.shutdown() */ const SHUTDOWN_MODE_DEFAULT: number; /** Constant for shutting down the Oracle database with oracledb.shutdown() and connection.shutdown() */ const SHUTDOWN_MODE_FINAL: number; /** Constant for shutting down the Oracle database with oracledb.shutdown() and connection.shutdown() */ const SHUTDOWN_MODE_IMMEDIATE: number; /** Constant for shutting down the Oracle database with oracledb.shutdown() and connection.shutdown() */ const SHUTDOWN_MODE_TRANSACTIONAL: number; /** Constant for shutting down the Oracle database with oracledb.shutdown() and connection.shutdown() */ const SHUTDOWN_MODE_TRANSACTIONAL_LOCAL: number; /** Constants for the vectorFormat attribute. */ const VECTOR_FORMAT_BINARY: number; /** Constants for the vectorFormat attribute. */ const VECTOR_FORMAT_FLOAT32: number; /** Constants for the vectorFormat attribute. */ const VECTOR_FORMAT_FLOAT64: number; /** Constants for the vectorFormat attribute. */ const VECTOR_FORMAT_INT8: number; /** * If true, the transaction in the current connection is automatically committed at the end of statement execution. * This property may be overridden in an execute() call. * * @default false * @since 0.5 */ let autoCommit: boolean; /** * The user-chosen Connection class value defines a logical name for connections. * Most single purpose applications should set connectionClass when using a connection pool or DRCP. * * When a pooled session has a connection class, Oracle ensures that the session is not shared outside of that connection class. * * The connection class value is similarly used by Database Resident Connection Pooling (DRCP) to allow or disallow sharing of sessions. * * For example, where two different kinds of users share one pool, you might set connectionClass to ‘HRPOOL’ for connections that * access a Human Resources system, and it might be set to ‘OEPOOL’ for users of an Order Entry system. * Users will only be given sessions of the appropriate class, allowing maximal reuse of resources in each case, * and preventing any session information leaking between the two systems. * * If connectionClass is set for a non-pooled connection, the driver name is not recorded in V$ views. */ let connectionClass: string; /** * Specify whether Oracle Database named objects or collections that are queried should be returned to the application * as “plain old JavaScript objects” or kept as database-backed objects. This option also applies to output BIND_OUT bind variables. * * Note that LOBs in objects will be represented as Lob instances and will not be String or Buffer, regardless of any fetchAsString, * fetchAsBuffer, or fetchInfo setting. * * Setting dbObjectAsPojo to true can avoid overhead if object attributes are repeatedly accessed. It also allows applications to * close connections before any attributes are accessed unless LOBs are involved. Regardless of the value, the interface to access objects is the same. * * @default false * @since 5.1 */ let dbObjectAsPojo: boolean; /** * This property is a function which converts the data type of the DbObject property to the desired data type. * This function is called once for each property inside a DbObject with a single object argument containing the following attributes: * type: The value of one of the Oracle Database Type Objects. * maxSize: The maximum number of bytes allocated. * typeName: The name of the object. * precision: Set only for oracledb.DB_TYPE_NUMBER type. * scale: Set only for oracledb.DB_TYPE_NUMBER type. * * The function is expected to return an object containing a converter attribute which works similar to the existing fetch type handler’s converters. * The DbObject type handler’s converter attribute is a function which accepts the incoming read value of the DbObject property and returns a transformed value (based on the required data type) for the same DbObject property. * This property is not applicable for LOB data type attributes of a DbObject type. * * @since 6.8 */ function dbObjectTypeHandler(metadata: Metadata<any>): FetchTypeResponse | undefined; /** * Sets the name used for Edition-Based Redefinition by connections. * * @since 2.2 */ let edition: string; /** * Determines whether Oracle Client events mode should be enabled. * * This property can be overridden in the oracledb.createPool() call and when getting a standalone connection from oracledb.getConnection(). * * Events mode is required for Continuous Query Notification, Fast Application Notification (FAN) and Runtime Load Balancing (RLB). * * @default true * @since 2.2 */ let events: boolean; /** * If true, connections will be established using external authentication. * * The user and password properties should not be set when externalAuth is true. * * This property can be overridden in the oracledb.createPool() call and when getting a standalone connection from oracledb.getConnection(). * * @default false * @since 0.5 */ let externalAuth: boolean; /** * This property sets the size of an internal buffer used for fetching query rows from Oracle Database. * Changing it may affect query performance but does not affect how many rows are returned to the application. * * The property is used during the default direct fetches, during ResultSet getRow() calls, and for queryStream(). It is not used for getRows(). * * Increasing this value reduces the number of round-trips to the database but increases memory usage for each data fetch. * For queries that return a large number of rows, higher values of fetchArraySize may give better performance. * For queries that only return a few rows, reduce the value of fetchArraySize to minimize the amount of memory management during data fetches. * JavaScript memory fragmentation may occur in some cases. * * For direct fetches (those using execute() option resultSet: false), the internal buffer size will be based on the lesser of maxRows and fetchArraySize. * * @default 100 * @since 2.0 */ let fetchArraySize: number; /** * Configure data types to be returned as a Buffer instead of the default representation when queried with execute() or queryStream(). * * Currently the only valid type is oracledb.BLOB. * * By default in node-oracledb, all columns are returned as native types or as Lob instances, in the case of CLOB and BLOB types. * * Individual query columns in execute() or queryStream() calls can override the fetchAsBuffer global setting by using fetchInfo. * * @since 1.13 */ let fetchAsBuffer: Array<typeof BLOB>; /** * An array of node-oracledb types. The valid types are oracledb.DATE, oracledb.NUMBER, oracledb.BUFFER, and oracledb.CLOB. * When any column having one of the specified types is queried with execute() or queryStream(), the column data is returned as a string instead of the default representation. * * By default in node-oracledb, all columns are returned as native types or as Lob instances, in the case of CLOB and BLOB types. * * This property helps avoid situations where using JavaScript types can lead to numeric precision loss, or where date conversion is unwanted. * * For raw data returned as a string, Oracle returns the data as a hex-encoded string. * For dates and numbers returned as a string, the maximum length of a string created by this mapping is 200 bytes. * Strings created for CLOB columns will generally be limited by Node.js and V8 memory restrictions. * * Individual query columns in execute() or queryStream() calls can override the fetchAsString global setting by using fetchInfo. * * For non-CLOB types, the conversion to string is handled by Oracle client libraries and is often referred to as defining the fetch type. */ let fetchAsString: Array<typeof DATE | typeof NUMBER | typeof BUFFER | typeof CLOB>; /** * Converter can be used with fetch type handlers to change the returned data. * If the value returned by the fetch type handler function is undefined then no conversion takes place. */ function converter<T>(arg: T | null): any; type FetchTypeResponse = | { type: DbType; converter?: typeof converter } | { type?: DbType; converter: typeof converter }; /** * This property is a function that allows applications to examine and modify queried column data before it is returned to the user. This function is called once for each column that is being fetched with a single object argument containing the following attributes: * annotations: The object representing the annotations. * byteSize: The maximum size in bytes. This is only set if dbType is oracledb.DB_TYPE_VARCHAR, oracledb.DB_TYPE_CHAR, or oracledb.DB_TYPE_RAW. * dbType: The database type, that is, one of the Oracle Database Type Objects. * dbColumnName: The actual database column name. This is to distinguish from the name attribute as the duplicate columns in the query will have the same value for this attribute. * dbTypeName: The name of the database type, such as “NUMBER” or “VARCHAR2”. * dbTypeClass: The class associated with the database type. This is only set if dbType is oracledb.DB_TYPE_OBJECT. * domainName: The name of the SQL domain. * domainSchema: The schema name of the SQL domain. * isJson: Indicates if the column is known to contain JSON data. * name: The name of the column. * nullable: Indicates whether NULL values are permitted for this column. * precision: Set only when the dbType is oracledb.DB_TYPE_NUMBER. * scale: Set only when the dbType is oracledb.DB_TYPE_NUMBER. * By default, this property is “undefined”, that is, it is not set. * The function is expected to return either nothing or an object containing: * the type attribute * or the converter attribute * or both the type and converter attributes * The converter function is a function which can be used with fetch type handlers to change the returned data. This function accepts the value that will be returned by connection.execute() for a particular row and column and returns the value that will actually be returned by connection.execute(). * This property can be overridden by the fetchTypeHandler option in execute(). */ function fetchTypeHandler(metadata: Metadata<any>): FetchTypeResponse | undefined; /** * The maximum number of rows that are fetched by a query with connection.execute() when not using a ResultSet. * Rows beyond this limit are not fetched from the database. A value of 0 means there is no limit. * * This property may be overridden in an execute() call. * * To improve database efficiency, SQL queries should use a row limiting clause like OFFSET / FETCH or equivalent. * The maxRows property can be used to stop badly coded queries from returning unexpectedly large numbers of rows. * * When the number of query rows is relatively big, or can not be predicted, it is recommended to use * a ResultSet or queryStream(). This allows applications to process rows in smaller chunks or individually, * preventing the Node.js memory limit being exceeded or query results being unexpectedly truncated by a * maxRows limit. * * @default 0 (unlimited) */ let maxRows: number; /** * This readonly property gives a numeric representation of the Oracle client library version which * is useful in comparisons. For version a.b.c.d.e, this property * gives the number: (100000000 * a) + (1000000 * b) + (10000 * c) + (100 * d) + e * * @since 1.3 */ const oracleClientVersion: number; /** * This readonly property gives a string representation of the Oracle client library version which is useful for display. * * @since 2.2 */ const oracleClientVersionString: string; /** * The format of query rows fetched when using connection.execute() or connection.queryStream(). * It affects both ResultSet and non-ResultSet queries. It can be used for top level queries and REF CURSOR output. * * This can be either of the Oracledb constants oracledb.ARRAY or oracledb.OBJECT. * * If specified as oracledb.ARRAY, each row is fetched as an array of column values. * * If specified as oracledb.OBJECT, each row is fetched as a JavaScript object. * The object has a property for each column name, with the property value set to the respective column value. * The property name follows Oracle’s standard name-casing rules. It will commonly be uppercase, * since most applications create tables using unquoted, case-insensitive names. * * From node-oracledb 5.1, when duplicate column names are used in queries, then node-oracledb will append * numeric suffixes in oracledb.OUT_FORMAT_OBJECT mode as necessary, so that all columns are represented in the JavaScript object. * * This property may be overridden in an execute() or queryStream() call. * * @default ARRAY */ let outFormat: number; /** * The number of connections that are opened whenever a connection request exceeds the number of currently open connections. * * This property may be overridden when creating a connection pool. * * @default 1 */ let poolIncrement: number; /** * The maximum number of connections to which a connection pool can grow. * * This property may be overridden when creating a connection pool. * * Importantly, if you increase poolMax you should also increase the number of threads available to node-oracledb. * * @default 4 */ let poolMax: number; /** * The maximum number of connections per shard for connection pools. This ensures that the pool is balanced towards each shard. * * This property may be overridden when creating a connection pool. * * When this property is set, and a new connection request would cause the number of connections to the target shard to exceed the limit, * then that new connection request will block until a suitable connection has been released back to the pool. * Importantly, when blocked, the queueTimeout value will be ignored and the pending connection request will consume one worker thread. * * @since 4.1 */ let poolMaxPerShard: number; /** * The minimum number of connections a connection pool maintains, even when there is no activity to the target database. * * This property may be overridden when creating a connection pool. * * For pools created with External Authentication or with homogeneous set to false, the number of * connections initially created is zero even if a larger value is specified for poolMin. * The pool increment is always 1, regardless of the value of poolIncrement. * Once the number of open connections exceeds poolMin and connections are idle for more than * the poolTimeout seconds, then the number of open connections does not fall below poolMin. * * @default 0 */ let poolMin: number; /** * When a pool getConnection() is called and the connection has been idle in the pool for at least * poolPingInterval seconds, node-oracledb internally “pings” the database to check the connection is alive. * After a ping, an unusable connection is destroyed and a usable one is returned by getConnection(). * Connection pinging improves the chance a pooled connection is valid when it is first used because * identified unusable connections will not be returned to the application. * * This property may be overridden when creating a connection pool. * * @default 60 * @since 1.12 */ let poolPingInterval: number | undefined; /** * The number of milliseconds that a connection should wait for a response from connection.ping(). Refer to oracledb.poolPingTimeout for details. * The default value is 5000 milliseconds. * This optional property overrides the oracledb.poolPingTimeout property. * See Connection Pool Pinging for more information. * * @since 6.4 */ let poolPingTimeout: number; /** * The number of seconds after which idle connections (unused in the pool) are terminated. * Idle connections are terminated only when the pool is accessed. If the poolTimeout is set to 0, * then idle connections are never terminated. * * This property may be overridden when creating a connection pool. * * @default 60 */ let poolTimeout: number; /** * This is a query tuning option to set the number of additional rows the underlying Oracle Client library * fetches during the internal initial statement execution phase of a query. The prefetch size does not affect when, or how many, * rows are returned by node-oracledb to the application. * * The prefetchRows attribute can be used in conjunction with oracledb.fetchArraySize to tune query performance, memory use, * and to reduce the number of round-trip calls needed to return query results. * * The prefetchRows value is ignored in some cases, such as when the query involves a LOB. * * If you fetch a REF CURSOR, retrieve rows from that cursor, and then pass it back to a PL/SQL block, you should set * prefetchRows to 0 during the initial statement that gets the REF CURSOR. This ensures that rows are not internally * fetched from the REF CURSOR by node-oracledb thus making them unavailable in the final PL/SQL code. * * This property may be overridden in an connection.execute() call, which is preferred usage if you need to change the value. * * This attribute is not used in node-oracledb version 2, 3 or 4. In those versions use only oracledb.fetchArraySize instead. * * @default 2 * @see https://node-oracledb.readthedocs.io/en/latest/user_guide/tuning.html#rowfetching */ let prefetchRows: number; /** * The oracledb.Promise property is no longer used in node-oracledb 5 and has no effect. * * Node-oracledb supports Promises on all methods. The native Promise library is used. * * @deprecated 5.0 */ let Promise: Promise<any>; /** * The number of milliseconds after which connection requests waiting in the connection request queue are terminated. * If queueTimeout is 0, then queued connection requests are never terminated. * * This property may be overridden when creating a connection pool. * * @default 60000 * @since 1.7 */ let queueTimeout: number; /** * The maximum number of pending pool.getConnection() calls that can be queued. * * When the number of pool.getConnection() calls that have been queued waiting for an available connection reaches queueMax, * then any future pool.getConnection() calls will immediately return an error and will not be queued. * * If queueMax is -1, then the queue length is not limited. * * This property may be overridden when creating a connection pool. * * @default 500 */ let queueMax: number; /** * This property can be set to throw an error if concurrent operations are attempted * on a single connection. * * The default value for errorOnConcurrentExecute is false. * * Each Oracle connection can only interact with the database for one operation at a time. * Attempting to do more than one operation concurrently may be a sign of an incorrectly coded application, * for example an await may be missing. * Examples of operations that cannot be executed in parallel on a single connection include connection.execute(), * connection.executeMany(), connection.queryStream(), connection.getDbObjectClass(), connection.commit(), * connection.close(), SODA calls, and streaming from Lobs. */ let errorOnConcurrentExecute: boolean; /** * This property was removed in node-oracledb 3.0 and queuing was always enabled. * In node-oracledb 5.0, set queueMax to 0 to disable queuing. * * @see https://node-oracledb.readthedocs.io/en/latest/user_guide/connection_handling.html#connpoolqueue */ let queueRequests: number; /** * The number of statements that are cached in the statement cache of each connection. * * This property may be overridden for specific Pool or Connection objects. * * In general, set the statement cache to the size of the working set of statements being * executed by the application. Statement caching can be disabled by setting the size to 0. * * @default 30 */ let stmtCacheSize: number; /** * This property is a boolean that determines the node-oracledb driver mode which is in use. If the value is true, it indicates that node-oracledb Thin mode is in use. * If the value is false, it indicates that node-oracledb Thick mode is in use. * The default value is true. * Immediately after node-oracledb is imported, this property is set to true indicating that node-oracledb defaults to Thin mode. If oracledb.initOracleClient() is called, * then the value of this property is set to False indicating that Thick mode is enabled. Once the first standalone connection or connection pool is created, * or a call to oracledb.initOracleClient() is made, then node-oracledb’s mode is fixed and the value set in oracledb.thin will never change for the lifetime of the process. * The property connection.thin can be used to check a connection’s mode and the attribute pool.thin can be used to check a pool’s mode. * The value that is displayed for the connection.thin, pool.thin, and oracledb.thin attributes will be the same. */ let thin: boolean; /** * This readonly property gives a numeric representation of the node-oracledb version. * For version x.y.z, this property gives the number: (10000 * x) + (100 * y) + z */ const version: number; /** * This readonly property gives a string representation of the node-oracledb version, including the version suffix if one is present. * * @since 2.1 */ const versionString: string; /** * This readonly property gives a string representing the version suffix (e.g. “-dev” or “-beta”) or an empty string if no version suffix is present. * * @since 2.1 */ const versionSuffix: string; interface BindParameter { /** * The direction of the bind. One of the Execute Bind Direction Constants. * * @see https://node-oracledb.readthedocs.io/en/latest/api_manual/oracledb.html#oracledbconstantsbinddir */ dir?: number | undefined; /** * The number of array elements to be allocated for a PL/SQL Collection INDEX BY associative * array OUT or IN OUT array bind variable. For IN binds, the value of maxArraySize is ignored. * * @see https://node-oracledb.readthedocs.io/en/latest/user_guide/objects.html#plsqlindexbybinds */ maxArraySize?: number | undefined; /** * The maximum number of bytes that an OUT or IN OUT bind variable of type STRING or BUFFER can use to get data. * * The maximum limit depends on the database type, see below. When binding IN OUT, then maxSize refers to the * size of the returned value: the input value can be smaller or bigger. For IN binds, maxSize is ignored. * * @default 200 */ maxSize?: number | undefined; /** * The node-oracledb or JavaScript data type to be bound. One of the Node-oracledb Type Constants. * * With IN or IN OUT binds the type can be explicitly set with type or it will default to the type * of the input data value. With OUT binds, the type defaults to oracledb.STRING whenever type is not specified. */ type?: DbType | number | string | undefined; /** * The input value or variable to be used for an IN or IN OUT bind variable. */ val?: any; } /** * Used with connection.executeMany() to define a bind variable's types, sizes and directions. */ interface BindDefinition { /** * The direction of the bind. One of the Execute Bind Direction Constants. * * @default BIND_IN */ dir?: number | undefined; /** * Required for Strings and Buffers. Ignored for other types. Specifies the maximum number of bytes * allocated when processing each value of this bind variable. When data is being passed into the database, * maxSize should be at least the size of the longest value. When data is being returned from the database, * maxSize should be the size of the longest value. If maxSize is too small, executeMany() will throw an * error that is not handled by batchErrors. */ maxSize?: number | undefined; /** * The node-oracledb or JavaScript data type to be bound. One of the Node-oracledb Type Constants. */ type?: DbType | number | undefined; } /** * Used with connection.execute() to associate values or JavaScript variables to a statement’s bind variables by name. * * @see https://node-oracledb.readthedocs.io/en/latest/api_manual/connection.html#executebindparams */ type BindParameters = | Record<string, BindParameter | string | number | bigint | Date | DBObject_IN<any> | Buffer | null | undefined> | BindParameter[] | any[]; interface CloseConnectionOptions { /** * If drop is false, then the connection is returned to the pool for reuse. * * If drop is true, the connection will be completely dropped from the connection pool * * @default false */ drop: boolean; } interface ResumeSessionlessTxnOpts { /** * The number of seconds that the current connection waits to resume a transaction if another connection is using it. * This timeout is only effective when the transaction is in use by another connection. * In this case, the current connection waits for the transaction to be suspended within this timeout period. * * @default 60s */ timeout?: number; /** Determines whether the request to start a transaction is to be sent immediately or with the next database operation. * * @default false */ deferRoundTrip?: boolean; } interface SessionlessTransactionOpts { /** A unique identifier for the sessionless transaction. */ transactionId?: string | Buffer; /** * The number of seconds before which this transaction can be resumed by a connection the next time that it is suspended. * If a transaction is not resumed within this specified duration, the transaction will be rolled back. * * @default 60s */ timeout?: number; /** Determines whether the request to start a transaction is to be sent immediately or with the next database operation. * * @default false */ deferRoundTrip?: boolean; } interface Connection { /** * The action attribute for end-to-end application tracing. * This is a write-only property. Displaying a Connection object will show a value of null for this attribute. */ action?: string | undefined; /** * Sets the maximum number of milliseconds that each underlying round-trip between no