Class for representing global mle-js-oracledb properties.

Hierarchy

  • Parameters

Accessors

  • get extendedMetaData(): boolean
  • Returns boolean

  • set extendedMetaData(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get fetchArraySize(): number
  • Returns number

  • set fetchArraySize(value: number): void
  • 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 default value is 10. The maximum allowed value is 1000, any value greater than that will silently be limited to 1000.

    The property is used during the default direct fetches and during IResultSet.getRow() and getRows() calls.

    Increasing this value reduces the number of context switches, 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. Note that as mle-js-oracledb is co-located with the database, large values are unlikely to yield significant benefit.

    For direct fetches (those using resultSet: false), the internal buffer size will be based on the lesser of maxRows and fetchArraySize.

    Parameters

    • value: number

    Returns void

  • get fetchAsPlsqlWrapper(): number[]
  • Returns number[]

  • set fetchAsPlsqlWrapper(value: number[]): void
  • An array of mle-js-oracledb JS Type values. The valid types are DATE, NUMBER, and STRING. When any column having one of the specified types is queried with execute(), the column data is returned as a PL/SQL wrapper type instead of the default representation.

    By default in mle-js-oracledb, all columns are returned as native types or as OracleClob/OracleBlob wrapper types, in the case of CLOB and BLOB types.

    For types that are set in both properties (fetchAsString and fetchAsPlsqlWrapper), i.e. DATE and NUMBER, the fetchAsString property has precedence over the fetchAsPlsqlWrapper property.

    Individual query columns in execute() calls can override the fetchAsPlsqlWrapper global property by using fetchInfo.

    Parameters

    • value: number[]

    Returns void

  • get fetchAsString(): number[]
  • Returns number[]

  • set fetchAsString(value: number[]): void
  • An array of mle-js-oracledb JS Type values. The valid types are DATE, NUMBER, UINT8ARRAY, ORACLE_CLOB, and DB_TYPE_JSON. When any column having one of the specified types is queried with execute(), the column data is returned as a string instead of the default representation.

    By default in mle-js-oracledb, all columns are returned as native types or as OracleClob/OracleBlob wrapper types, 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. See https://github.com/oracle/node-oracledb/blob/v3.1.0/doc/api.md#-1316-query-result-type-mapping for more discussion.

    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 memory restrictions.

    Individual query columns in execute() calls can override the fetchAsString global property by using fetchInfo.

    Parameters

    • value: number[]

    Returns void

  • get fetchAsUint8Array(): number[]
  • Returns number[]

  • set fetchAsUint8Array(value: number[]): void
  • An array of mle-js-oracledb JS Type values. Currently, the only valid type is ORACLE_BLOB. When a BLOB column is queried with execute(), the column data is returned as a Uint8Array instead of the default representation.

    By default in mle-js-oracledb, all columns are returned as native types or as OracleClob/OracleBlob wrapper types, in the case of CLOB and BLOB types.

    Individual query columns in execute() calls can override the fetchAsUint8Array global property by using fetchInfo.

    Parameters

    • value: number[]

    Returns void

  • get maxRows(): number
  • Returns number

  • set maxRows(value: number): void
  • The maximum number of rows that are fetched by a query with connection.execute() when not using an IResultSet. Rows beyond this limit are not fetched from the database. A value of 0 means there is no limit.

    The default value is 0, meaning unlimited.

    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 cannot be predicted, it is recommended to use an IResultSet. This allows applications to process rows in smaller chunks or individually, preventing the PGA limits from being exceeded or query results being unexpectedly truncated by a maxRows limit.

    Parameters

    • value: number

    Returns void

  • get outFormat(): number
  • Returns number

  • set outFormat(value: number): void
  • The format of query rows fetched when using connection.execute(). It affects both IResultSet and non-IResultSet queries. This can be either of the constants OUT_FORMAT_ARRAY or OUT_FORMAT_OBJECT. The default value is OUT_FORMAT_ARRAY when requiring the module "mle-js-oracledb" (in Oracle 21c). Oracle 23ai introduces and encourages the use of ECMAScript imports (import oracledb from "mle-js-oracledb") and if those are used, the default value is OUT_FORMAT_OBJECT.

    If specified as OUT_FORMAT_ARRAY, each row is fetched as an array of column values.

    If specified as OUT_FORMAT_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.

    This property may be overridden in an execute() call.

    Parameters

    • value: number

    Returns void