Skip to content

Commit 56a7c4e

Browse files
committed
Release 23.5
1 parent ccc66dc commit 56a7c4e

File tree

13 files changed

+181
-40
lines changed

13 files changed

+181
-40
lines changed

README.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The following JavaScript modules are currently available:
1111
- MLE PL/SQL Types: [mle-js-plsqltypes][mle-js-plsqltypes]
1212
- MLE Fetch API polyfill: [mle-js-fetch][mle-js-fetch]
1313
- MLE Base64 Encoding: [mle-encode-base64][mle-encode-base64]
14+
- MLE Encodings: [mle-js-encodings][mle-js-encodings]
1415

1516
## Installation
1617
You need an Oracle Database to make use of the JavaScript modules provided in the Oracle Database Multilingual Engine (MLE).
@@ -33,6 +34,8 @@ npm install mle-js-oracledb
3334
npm install mle-js-bindings
3435
npm install mle-js-plsqltypes
3536
npm install mle-js-fetch
37+
npm install mle-encode-base64
38+
npm install mle-js-encodings
3639
```
3740

3841
## Documentation
@@ -91,33 +94,40 @@ The following table shows which version of module documentation and declarations
9194

9295
| Oracle Database | Declarations | Documentation |
9396
| ---------------- | ------------ | ------------- |
94-
| 23ai | [[email protected]][mle-js-types-234] for Oracle 23.4 <br/> [[email protected]][mle-js-types-233] for Oracle 23.3 <br/> [[email protected]][mle-js-types-232] for Oracle 23.2 - Free | **[mle-js (23ai)][mle-js]** <br/> [mle-js-oracledb (23ai)][mle-js-oracledb] <br/> [mle-js-bindings (23ai)][mle-js-bindings] <br/> [mle-js-plsqltypes (23ai)][mle-js-plsqltypes] <br/> [mle-js-fetch (23ai)][mle-js-fetch] <br/> [mle-encode-base64 (23ai)][mle-encode-base64]|
97+
| 23ai | [mle-js@23.5.0][mle-js-types-235] for Oracle 23.5 <br/> [mle-js@23.4.0][mle-js-types-234] for Oracle 23.4 <br/> [[email protected]][mle-js-types-233] for Oracle 23.3 <br/> [[email protected]][mle-js-types-232] for Oracle 23.2 - Free | **[mle-js (23ai)][mle-js]** <br/> [mle-js-oracledb (23ai)][mle-js-oracledb] <br/> [mle-js-bindings (23ai)][mle-js-bindings] <br/> [mle-js-plsqltypes (23ai)][mle-js-plsqltypes] <br/> [mle-js-fetch (23ai)][mle-js-fetch] <br/> [mle-encode-base64 (23ai)][mle-encode-base64]|
9598
| 21c | [[email protected]][mle-js-types-213] | [mle-js-oracledb (21c)][mle-js-oracledb-21c] <br/> [mle-js-bindings (21c)][mle-js-bindings-21c] <br/> [mle-js-plsqltypes (21c)][mle-js-plsqltypes-21c] |
9699

97100
## Examples
98101
The following code snippet exemplifies the usage of some of these MLE modules combined.
99102
For additional examples, please check the module documentation pages or have a look at our [blog article][2].
100103

101104
```JavaScript
102-
// imports
103-
const oracledb = require('mle-js-oracledb');
104-
const bindings = require('mle-js-bindings');
105-
const plsqltypes = require("mle-js-plsqltypes");
106-
107-
// Read a large number as an Oracle NUMBER from SQL and add another ORACLE NUMBER to it.
108-
// mle-js-oracledb is used for reading from SQL and mle-js-plsqltypes is used to construct the second Oracle NUMBER.
109-
const conn = oracledb.defaultConnection();
110-
const query = "SELECT 9007199254740992 AS n FROM dual";
111-
const options = { fetchInfo: { N: { type: oracledb.ORACLE_NUMBER } } };
112-
const queryResult = conn.execute(query, [], options);
113-
const OracleNumber = plsqltypes.OracleNumber;
114-
const result = queryResult.rows[0][0].add(new OracleNumber(7));
115-
116-
// Use mle-js-bindings to export the result of the computation.
117-
// On the database side, this result could be retrieved using something like `dbms_mle.import_from_mle(ctx, 'result', result);`.
118-
bindings.exportValue("result", result);
105+
async function run() {
106+
// import modules that do not have global symbols
107+
const bindings = await import('mle-js-bindings');
108+
109+
// Read a large number as an Oracle NUMBER from SQL and add another ORACLE NUMBER to it.
110+
// mle-js-oracledb (session) is used for reading from SQL and mle-js-plsqltypes (OracleNumber) is used to construct the second Oracle NUMBER.
111+
const query = "SELECT 9007199254740992 AS n FROM dual";
112+
const options = { fetchInfo: { N: { type: oracledb.ORACLE_NUMBER } } };
113+
const queryResult = session.execute(query, [], options);
114+
const result = queryResult.rows[0].N.add(new OracleNumber(7));
115+
116+
// print result to the console before exporting it
117+
console.log(result);
118+
119+
// Use mle-js-bindings to export the result of the computation.
120+
// On the database side, this result could be retrieved using something like `dbms_mle.import_from_mle(ctx, 'result', result);`.
121+
bindings.exportValue("result", result);
122+
}
123+
run();
119124
```
120125

126+
## Building and deploying larger JavaScript projects
127+
If you plan to use database-side JavaScript at a larger scale, we highly
128+
recommend to read our blog post on [Linting MLE JavaScript Modules in Continuous
129+
Integration Pipelines][4].
130+
121131
## Help
122132
If you have questions or change requests about MLE, please [create a ticket](./CONTRIBUTING.md) or contact [Oracle Support](https://support.oracle.com).
123133

@@ -144,10 +154,12 @@ Released under the Universal Permissive License v1.0 as shown at <https://oss.or
144154
[mle-js-oracledb-21c]: https://oracle-samples.github.io/mle-modules/docs/mle-js-oracledb/21c "mle-js-oracledb 21c"
145155
[mle-js-bindings-21c]: https://oracle-samples.github.io/mle-modules/docs/mle-js-bindings/21c "mle-js-bindings 21c"
146156
[mle-js-plsqltypes-21c]: https://oracle-samples.github.io/mle-modules/docs/mle-js-plsqltypes/21c "mle-js-plsqltypes 21c"
157+
[mle-js-types-235]: https://www.npmjs.com/package/mle-js/v/23.5.0 "[email protected]"
147158
[mle-js-types-234]: https://www.npmjs.com/package/mle-js/v/23.4.0 "[email protected]"
148159
[mle-js-types-233]: https://www.npmjs.com/package/mle-js/v/23.3.0 "[email protected]"
149160
[mle-js-types-232]: https://www.npmjs.com/package/mle-js/v/23.2.0 "[email protected]"
150161
[mle-js-types-213]: https://www.npmjs.com/package/mle-js/v/21.3.1 "[email protected]"
151162
[1]: https://blogs.oracle.com/developers/post/introduction-javascript-oracle-database-23c-free-developer-release "Introduction to JavaScript in Oracle Database 23c Free - Developer Release"
152163
[2]: https://blogs.oracle.com/apex/post/mle-and-the-future-of-server-side-programming-in-oracle-apex "MLE and the Future of Server-Side Programming in Oracle APEX"
153164
[3]: https://docs.oracle.com/en/database/oracle/oracle-database "Oracle Database"
165+
[4]: https://blogs.oracle.com/developers/post/linting-mle-javascript-modules-in-continuous-integration-pipelines "JavaScript CI/CD blog"

THIRD_PARTY_LICENSES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Third Party Attributions for Code
22

33
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4-
TypeDoc 0.23.19 TypeDoc Contributors
4+
TypeDoc 0.23.28 TypeDoc Contributors
55
(https://github.com/TypeStrong/typedoc/graphs/contributors)
66
Apache 2.0
77
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

declarations/mle-encode-base64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "MLE functions to work with base64 encoded data",
44
"types": "mle-encode-base64.d.ts",
55
"author": "Oracle",
6-
"version": "23.4.0",
6+
"version": "23.5.0",
77
"license": "UPL-1.0",
88
"homepage": "https://oracle-samples.github.io/mle-modules",
99
"repository": {

declarations/mle-js-bindings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "MLE Bindings for Oracle Database DBMS_MLE",
44
"types": "mle-js-bindings.d.ts",
55
"author": "Oracle",
6-
"version": "23.4.0",
6+
"version": "23.5.0",
77
"license": "UPL-1.0",
88
"homepage": "https://oracle-samples.github.io/mle-modules",
99
"repository": {

declarations/mle-js-encodings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "MLE text encoding API",
44
"types": "index.d.ts",
55
"author": "Oracle",
6-
"version": "23.4.0",
6+
"version": "23.5.0",
77
"license": "UPL-1.0",
88
"homepage": "https://oracle-samples.github.io/mle-modules",
99
"repository": {

declarations/mle-js-fetch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "MLE Fetch API polyfill",
44
"types": "index.d.ts",
55
"author": "Oracle",
6-
"version": "23.4.0",
6+
"version": "23.5.0",
77
"license": "UPL-1.0",
88
"homepage": "https://oracle-samples.github.io/mle-modules",
99
"repository": {

declarations/mle-js-oracledb/api.d.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,17 +467,29 @@ export declare abstract class IConnection {
467467
* affected by the execution of DML statements, see {@link IExecuteReturn}.
468468
*
469469
* See
470-
* https://github.com/oracle/node-oracledb/blob/v3.1.0/doc/api.md#-426-connectionexecute
470+
* https://node-oracledb.readthedocs.io/en/v6.4.0/api_manual/connection.html#connection.execute
471471
* for more details.
472472
*
473-
* @param sql SQL statement that is executed. The statement may contain bind
474-
* parameters.
473+
* @param sql This parameter can either be a string or an object.
474+
* If the parameter is a string, then it is the SQL statement to be executed.
475+
* The statement may contain bind parameters.
476+
*
477+
* If the parameter is an object (possible since Oracle 23.5),
478+
* it conforms to the {@link IExecuteArgs} interface
479+
* and contains the SQL statement to be executed and the bind values.
480+
*
481+
* This object exposes the SQL statement and values properties to retrieve the SQL string and bind values
482+
* The statement may contain bind parameters.
475483
* @param bindParams needed if there are bind parameters in the SQL
476484
* statement, see {@link BindParameters}.
477485
* @param options an optional parameter to execute() that may be used to
478486
* control statement execution.
479487
*/
480488
abstract execute(sql: string): IExecuteReturn;
489+
/**
490+
* @since Oracle 23.5
491+
*/
492+
abstract execute(sql: IExecuteArgs, options?: IExecuteOptions): IExecuteReturn;
481493
abstract execute(sql: string, bindParams: BindParameters, options?: IExecuteOptions): IExecuteReturn;
482494
/**
483495
* This method allows sets of data values to be bound to one DML or PL/SQL
@@ -565,6 +577,21 @@ export declare abstract class IConnection {
565577
*/
566578
abstract getDbObjectClass(className: string): IDbObjectClass;
567579
}
580+
/**
581+
* Interface for representing {@link execute} 's argument.
582+
*
583+
* @since Oracle 23.5
584+
*/
585+
export interface IExecuteArgs {
586+
/**
587+
* The sql text of the statement to be executed.
588+
*/
589+
statement: string;
590+
/**
591+
* An array that contains bind values.
592+
*/
593+
values: [];
594+
}
568595
/**
569596
* Interface for representing a DbObject attribute.
570597
*

declarations/mle-js-oracledb/mle-js-oracledb-common.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ export declare class OracleDb {
5555
ORACLE_TIMESTAMP: number;
5656
ORACLE_TIMESTAMP_TZ: number;
5757
UINT8ARRAY: number;
58+
/**
59+
* @since Oracle 23.4
60+
*/
61+
INT8ARRAY: number;
62+
/**
63+
* @since Oracle 23.4
64+
*/
65+
FLOAT32ARRAY: number;
66+
/**
67+
* @since Oracle 23.4
68+
*/
69+
FLOAT64ARRAY: number;
5870
DB_TYPE_VARCHAR: number;
5971
DB_TYPE_NUMBER: number;
6072
DB_TYPE_LONG: number;
@@ -77,6 +89,10 @@ export declare class OracleDb {
7789
DB_TYPE_NCHAR: number;
7890
DB_TYPE_NCLOB: number;
7991
DB_TYPE_JSON: number;
92+
/**
93+
* @since Oracle 23.3
94+
*/
95+
DB_TYPE_OBJECT: number;
8096
/**
8197
* @since Oracle 23.4
8298
*/

declarations/mle-js-oracledb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "MLE SQL Driver",
44
"types": "index.d.ts",
55
"author": "Oracle",
6-
"version": "23.4.0",
6+
"version": "23.5.0",
77
"license": "UPL-1.0",
88
"homepage": "https://oracle-samples.github.io/mle-modules",
99
"repository": {

declarations/mle-js-plsqltypes/mle-js-plsqltypes.d.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3535
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3636
SOFTWARE.
3737
*/
38+
/**
39+
* declare Operators object
40+
*
41+
* @since Oracle 23.5
42+
*/
43+
declare const OracleNumberOperators: any;
3844
/**
3945
* JavaScript API for Oracle type TIMESTAMP.
4046
*/
@@ -62,7 +68,7 @@ export declare const OracleDate: IOracleDate;
6268
/**
6369
* JavaScript API for Oracle type NUMBER.
6470
*/
65-
export declare class OracleNumber {
71+
export declare class OracleNumber extends OracleNumberOperators {
6672
private impl;
6773
/**
6874
* Construct an OracleNumber from a JavaScript number or a string.
@@ -1196,3 +1202,12 @@ export declare class IOracleDate {
11961202
*/
11971203
isValid(): boolean;
11981204
}
1205+
/**
1206+
* JsonId class is used to represent "_id" field in soda document
1207+
*
1208+
* @since Oracle 23.5
1209+
*/
1210+
export declare class JsonId extends Uint8Array {
1211+
toJSON(): string;
1212+
}
1213+
export {};

0 commit comments

Comments
 (0)