JavaScript Implementation Details

The MLE implementation of JavaScript is compliant with ECMAScript 2023.

Adhering to the ECMA standard, the JavaScript implementation as found in MLE is consciously created as a pure implementation. Native JavaScript network and file I/O operations are not supported in the same way that they are in Node.js and Deno for security reasons. The use of network and file I/O is possible with MLE, however, you must employ PL/SQL APIs such as UTL_HTTP and UTL_FILE.

The WEB API, Fetch, is not available by default in the global space but can be enabled by importing mle-js-fetch.

Objects not included in the ECMA standard, including common objects used in front-end code such as the Window object, are also not available with MLE. Nevertheless, MLE does provide easy and efficient access to SQL, which is able to execute close to the data. Console output is passed to DBMS_OUTPUT by default but can be redirected and stored in a user provided CLOB if required.

Users require specific privileges before they can interact with MLE. These can broadly be classified into:

  • Permission to use MLE and run JavaScript code

  • Execute dynamic JavaScript in the database

  • Create JavaScript modules and externalize them via PL/SQL code

The database engine throws an error if you lack sufficient privileges required for the use of JavaScript.

See Also:

System and Object Privileges Required for Working with JavaScript in MLE for more information about privileges

Compatible Web APIs

A number of Web APIs defined in the JavaScript standard library are available for use directly within in-database JavaScript. The following list includes the supported APIs and the specific symbols available for each.

For details about each Web API and its associated symbols, see MDN Documentation.

  • URL API: Defines URLs, domains, IP addresses, the application/x-www-form-urlencoded format, and their API.
    • URL
    • URLSearchParams
  • Streams API: Provides APIs for creating, composing, and consuming streams of data that map efficiently to low-level I/O primitives.
    • ReadableStream
    • ReadableByteStreamController
    • ReadableStreamBYOBReader
    • ReadableStreamBYOBRequest
    • ReadableStreamDefaultReader
    • ReadableStreamDefaultController
    • WritableStream
    • WritableStreamDefaultController
    • ByteLengthQueuingStrategy
    • CountQueuingStrategy
    • TransformStream
    • TransformStreamDefaultController
  • Encoding API: Defines text encodings and their JavaScript API.
    • TextEncoderStream
    • TextDecoderStream
  • Compression Streams API: Defines a set of JavaScript APIs to compress and decompress streams of binary data.
    • CompressionStream
    • DecompressionStream
  • Document Object Model (DOM) Standard: Defines a platform-neutral model for events, aborting activities, and node trees. Other APIs (for example, streams) rely on the model for events and aborting activities. The following are implemented:
    • DOMexception
    • AbortSignal
    • AbortController
    • Event
    • EventTarget
    • CustomEvent
  • Window Interface:
    • atob
    • btoa
    • navigator.useragent (where navigator is an object and useragent has the value "OracleMLE")
    • queueMicrotask
    • structuredClone
  • Performance APIs:
    • performance.now
    • performance.timeOrigin
  • File API: Provides an API for representing file objects in web applications, as well as programmatically selecting them and accessing their data.
    • Blob (1 GB limit)