@sqb/oracle-dialect 4.1.4 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/OracleSerializer.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OracleSerializer = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const compareVersion = tslib_1.__importStar(require("compare-versions"));
|
|
6
4
|
const builder_1 = require("@sqb/builder");
|
|
7
5
|
const reservedWords = ['comment', 'dual'];
|
|
8
6
|
class OracleSerializer {
|
|
@@ -29,6 +27,8 @@ class OracleSerializer {
|
|
|
29
27
|
return this._serializeBooleanValue(ctx, o);
|
|
30
28
|
case builder_1.SerializationType.RETURNING_BLOCK:
|
|
31
29
|
return this._serializeReturning();
|
|
30
|
+
case builder_1.SerializationType.STRINGAGG_STATEMENT:
|
|
31
|
+
return this._serializeStringAGG(ctx, o, defFn);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
_serializeSelect(ctx, o, defFn) {
|
|
@@ -36,7 +36,7 @@ class OracleSerializer {
|
|
|
36
36
|
const limit = o.limit || 0;
|
|
37
37
|
const offset = Math.max((o.offset || 0), 0);
|
|
38
38
|
if (limit || offset) {
|
|
39
|
-
if (ctx.dialectVersion &&
|
|
39
|
+
if (ctx.dialectVersion && ctx.dialectVersion >= '12') {
|
|
40
40
|
if (offset)
|
|
41
41
|
out += '\nOFFSET ' + offset + ' ROWS' +
|
|
42
42
|
(limit ? ' FETCH NEXT ' + limit + ' ROWS ONLY' : '');
|
|
@@ -95,6 +95,15 @@ class OracleSerializer {
|
|
|
95
95
|
_serializeBooleanValue(_ctx, o) {
|
|
96
96
|
return o == null ? 'null' : (o ? '1' : '0');
|
|
97
97
|
}
|
|
98
|
+
// noinspection JSUnusedLocalSymbols
|
|
99
|
+
_serializeStringAGG(ctx, o,
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
101
|
+
defFn) {
|
|
102
|
+
return 'listagg(' + o.field +
|
|
103
|
+
',\'' + o.delimiter + '\') within group (' +
|
|
104
|
+
(o.orderBy ? o.orderBy : 'order by null') + ')' +
|
|
105
|
+
(o.alias ? ' ' + o.alias : '');
|
|
106
|
+
}
|
|
98
107
|
_serializeReturning() {
|
|
99
108
|
return '';
|
|
100
109
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqb/oracle-dialect",
|
|
3
3
|
"description": "SQB serialization extension for Oracle database",
|
|
4
|
-
"version": "4.1
|
|
4
|
+
"version": "4.2.1",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Eray Hanoglu <e.hanoglu@panates.com>"
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/sqbjs/sqb.git"
|
|
12
|
+
"url": "https://github.com/sqbjs/sqb.git",
|
|
13
|
+
"directory": "packages/oracle-dialect"
|
|
13
14
|
},
|
|
14
15
|
"keywords": [
|
|
15
16
|
"javascript",
|
|
@@ -21,14 +22,11 @@
|
|
|
21
22
|
"oracle",
|
|
22
23
|
"database"
|
|
23
24
|
],
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"compare-versions": "^4.1.3"
|
|
26
|
-
},
|
|
27
25
|
"devDependencies": {
|
|
28
26
|
"fast-glob": "^3.2.11"
|
|
29
27
|
},
|
|
30
28
|
"peerDependencies": {
|
|
31
|
-
"@sqb/builder": "^4.
|
|
29
|
+
"@sqb/builder": "^4.2.0"
|
|
32
30
|
},
|
|
33
31
|
"main": "dist/index.js",
|
|
34
32
|
"types": "dist/index.d.ts",
|