@sqb/oracle-dialect 4.15.0 → 4.16.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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/esm/index.js CHANGED
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const builder_1 = require("@sqb/builder");
4
- const oracle_serializer_js_1 = require("./oracle-serializer.js");
5
- builder_1.SerializerRegistry.register(new oracle_serializer_js_1.OracleSerializer());
1
+ import { SerializerRegistry } from '@sqb/builder';
2
+ import { OracleSerializer } from './oracle-serializer.js';
3
+ SerializerRegistry.register(new OracleSerializer());
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OracleSerializer = void 0;
4
- const builder_1 = require("@sqb/builder");
1
+ import { OperatorType, SerializationType, } from '@sqb/builder';
5
2
  const reservedWords = ['comment', 'dual'];
6
- class OracleSerializer {
3
+ export class OracleSerializer {
7
4
  constructor() {
8
5
  this.dialect = 'oracle';
9
6
  }
@@ -12,23 +9,23 @@ class OracleSerializer {
12
9
  }
13
10
  serialize(ctx, type, o, defFn) {
14
11
  switch (type) {
15
- case builder_1.SerializationType.SELECT_QUERY:
12
+ case SerializationType.SELECT_QUERY:
16
13
  return this._serializeSelect(ctx, o, defFn);
17
- case builder_1.SerializationType.SELECT_QUERY_FROM:
14
+ case SerializationType.SELECT_QUERY_FROM:
18
15
  return this._serializeFrom(ctx, o, defFn);
19
- case builder_1.SerializationType.COMPARISON_EXPRESSION:
16
+ case SerializationType.COMPARISON_EXPRESSION:
20
17
  return this._serializeComparison(ctx, o, defFn);
21
- case builder_1.SerializationType.STRING_VALUE:
18
+ case SerializationType.STRING_VALUE:
22
19
  return this._serializeStringValue(ctx, o, defFn);
23
- case builder_1.SerializationType.DATE_VALUE:
20
+ case SerializationType.DATE_VALUE:
24
21
  return this._serializeDateValue(ctx, o, defFn);
25
- case builder_1.SerializationType.BOOLEAN_VALUE:
22
+ case SerializationType.BOOLEAN_VALUE:
26
23
  return this._serializeBooleanValue(ctx, o);
27
- case builder_1.SerializationType.RETURNING_BLOCK:
24
+ case SerializationType.RETURNING_BLOCK:
28
25
  return this._serializeReturning();
29
- case builder_1.SerializationType.STRINGAGG_STATEMENT:
26
+ case SerializationType.STRINGAGG_STATEMENT:
30
27
  return this._serializeStringAGG(ctx, o, defFn);
31
- case builder_1.SerializationType.SEQUENCE_GETTER_STATEMENT:
28
+ case SerializationType.SEQUENCE_GETTER_STATEMENT:
32
29
  return this._serializeSequenceGetter(ctx, o, defFn);
33
30
  default:
34
31
  break;
@@ -82,9 +79,9 @@ class OracleSerializer {
82
79
  o.right.expression = ctx.anyToSQL(o.right.value);
83
80
  o.right.isParam = false;
84
81
  if (o.operatorType === 'eq')
85
- return defFn(ctx, { ...o, operatorType: builder_1.OperatorType.is, symbol: 'in' });
82
+ return defFn(ctx, { ...o, operatorType: OperatorType.is, symbol: 'in' });
86
83
  if (o.operatorType === 'ne')
87
- return defFn(ctx, { ...o, operatorType: builder_1.OperatorType.isNot, symbol: 'not in' });
84
+ return defFn(ctx, { ...o, operatorType: OperatorType.isNot, symbol: 'not in' });
88
85
  }
89
86
  else if ((o.right?.expression && o.right?.expression === 'null') ||
90
87
  (o.right && o.right?.value == null && (!o.right.expression || o.right.expression.startsWith(':')))) {
@@ -100,9 +97,9 @@ class OracleSerializer {
100
97
  o.right.isParam = false;
101
98
  }
102
99
  if (o.operatorType === 'eq')
103
- return defFn(ctx, { ...o, operatorType: builder_1.OperatorType.is, symbol: 'is' });
100
+ return defFn(ctx, { ...o, operatorType: OperatorType.is, symbol: 'is' });
104
101
  if (o.operatorType === 'ne')
105
- return defFn(ctx, { ...o, operatorType: builder_1.OperatorType.isNot, symbol: 'is not' });
102
+ return defFn(ctx, { ...o, operatorType: OperatorType.isNot, symbol: 'is not' });
106
103
  }
107
104
  return defFn(ctx, o);
108
105
  }
@@ -145,4 +142,3 @@ class OracleSerializer {
145
142
  return '';
146
143
  }
147
144
  }
148
- exports.OracleSerializer = OracleSerializer;
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@sqb/oracle-dialect",
3
3
  "description": "SQB serialization extension for Oracle database",
4
- "version": "4.15.0",
4
+ "version": "4.16.1",
5
5
  "author": "Panates",
6
6
  "license": "Apache-2.0",
7
7
  "scripts": {
8
8
  "compile": "tsc",
9
9
  "prebuild": "npm run lint && npm run clean",
10
10
  "build": "npm run build:cjs && npm run build:esm",
11
- "build:cjs": "tsc -b tsconfig-build-cjs.json",
12
- "build:esm": "tsc -b tsconfig-build-esm.json",
11
+ "build:cjs": "tsc -b tsconfig-build-cjs.json && cp ../../support/package.cjs.json ../../build/oracle-dialect/cjs/package.json",
12
+ "build:esm": "tsc -b tsconfig-build-esm.json && cp ../../support/package.esm.json ../../build/oracle-dialect/esm/package.json",
13
13
  "postbuild": "cp README.md package.json ../../LICENSE ../../build/oracle-dialect",
14
14
  "lint": "eslint . --max-warnings=0",
15
15
  "lint:fix": "eslint . --max-warnings=0 --fix",
@@ -21,19 +21,30 @@
21
21
  "clean:dist": "rimraf ../../build/oracle-dialect",
22
22
  "clean:cover": "rimraf ../../coverage/oracle-dialect"
23
23
  },
24
+ "dependencies": {
25
+ "tslib": "^2.6.3"
26
+ },
24
27
  "peerDependencies": {
25
- "@sqb/builder": "^4.15.0"
28
+ "@sqb/builder": "^4.16.1"
26
29
  },
27
- "main": "./cjs/index.js",
28
- "module": "./esm/index.js",
29
- "types": "./types/index.d.ts",
30
+ "type": "module",
30
31
  "exports": {
31
32
  ".": {
32
- "require": "./cjs/index.js",
33
- "import": "./esm/index.js",
34
- "types": "./types/index.d.ts"
35
- }
33
+ "import": {
34
+ "types": "./types/index.d.ts",
35
+ "default": "./esm/index.js"
36
+ },
37
+ "require": {
38
+ "types": "./types/index.d.ts",
39
+ "default": "./cjs/index.js"
40
+ },
41
+ "default": "./esm/index.js"
42
+ },
43
+ "./package.json": "./package.json"
36
44
  },
45
+ "main": "./cjs/index.js",
46
+ "module": "./esm/index.js",
47
+ "types": "./types/index.d.ts",
37
48
  "contributors": [
38
49
  "Eray Hanoglu <e.hanoglu@panates.com>",
39
50
  "Ilker Gurelli <i.gurelli@panates.com>"