@abaplint/runtime 2.7.72 → 2.7.74
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/build/src/index.d.ts +2 -0
- package/build/src/index.js +2 -0
- package/build/src/prefix.d.ts +1 -1
- package/build/src/prefix.js +10 -5
- package/build/src/statements/delete_database.js +2 -2
- package/build/src/statements/insert_database.js +1 -1
- package/build/src/statements/replace.js +3 -0
- package/build/src/statements/update_database.js +1 -1
- package/package.json +1 -1
package/build/src/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { expandDynamic } from "./expand_dynamic";
|
|
|
14
14
|
import { ClassicError } from "./classic_error";
|
|
15
15
|
import { Console } from "./console/console";
|
|
16
16
|
import { MemoryConsole } from "./console/memory_console";
|
|
17
|
+
import { buildDbTableName } from "./prefix";
|
|
17
18
|
export { UnitTestResult, RFC, types, DB, MemoryConsole };
|
|
18
19
|
export type RuntimeDatabaseOptions = {
|
|
19
20
|
schemaPrefix?: string;
|
|
@@ -58,6 +59,7 @@ export declare class ABAP {
|
|
|
58
59
|
templateFormatting: typeof templateFormatting;
|
|
59
60
|
expandIN: typeof expandIN;
|
|
60
61
|
expandDynamic: typeof expandDynamic;
|
|
62
|
+
buildDbTableName: typeof buildDbTableName;
|
|
61
63
|
ClassicError: typeof ClassicError;
|
|
62
64
|
readonly context: Context;
|
|
63
65
|
readonly dbo: RuntimeDatabaseOptions;
|
package/build/src/index.js
CHANGED
|
@@ -22,6 +22,7 @@ const classic_error_1 = require("./classic_error");
|
|
|
22
22
|
const standard_out_console_1 = require("./console/standard_out_console");
|
|
23
23
|
const memory_console_1 = require("./console/memory_console");
|
|
24
24
|
Object.defineProperty(exports, "MemoryConsole", { enumerable: true, get: function () { return memory_console_1.MemoryConsole; } });
|
|
25
|
+
const prefix_1 = require("./prefix");
|
|
25
26
|
class ABAP {
|
|
26
27
|
constructor(input) {
|
|
27
28
|
// global objects
|
|
@@ -41,6 +42,7 @@ class ABAP {
|
|
|
41
42
|
this.templateFormatting = template_formatting_1.templateFormatting;
|
|
42
43
|
this.expandIN = expand_in_1.expandIN;
|
|
43
44
|
this.expandDynamic = expand_dynamic_1.expandDynamic;
|
|
45
|
+
this.buildDbTableName = prefix_1.buildDbTableName;
|
|
44
46
|
this.ClassicError = classic_error_1.ClassicError;
|
|
45
47
|
this.context = new context_1.Context();
|
|
46
48
|
this.console = (input === null || input === void 0 ? void 0 : input.console) ? input === null || input === void 0 ? void 0 : input.console : new standard_out_console_1.StandardOutConsole();
|
package/build/src/prefix.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function buildDbTableName(table: string): string;
|
package/build/src/prefix.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.buildDbTableName = void 0;
|
|
4
|
+
function buildDbTableName(table) {
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
let ret = `"${abap.dbo.tablePrefix + table.trimEnd().toLowerCase()}"`;
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
if (abap.dbo.schemaPrefix !== "") {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
ret = `"${abap.dbo.schemaPrefix}".` + ret;
|
|
11
|
+
}
|
|
12
|
+
return ret;
|
|
8
13
|
}
|
|
9
|
-
exports.
|
|
14
|
+
exports.buildDbTableName = buildDbTableName;
|
|
10
15
|
//# sourceMappingURL=prefix.js.map
|
|
@@ -32,7 +32,7 @@ class DeleteDatabase {
|
|
|
32
32
|
}
|
|
33
33
|
where = where.join(" AND ");
|
|
34
34
|
const { subrc, dbcnt } = await this.context.defaultDB().delete({
|
|
35
|
-
table: (0, prefix_1.
|
|
35
|
+
table: (0, prefix_1.buildDbTableName)(table),
|
|
36
36
|
where,
|
|
37
37
|
});
|
|
38
38
|
// @ts-ignore
|
|
@@ -42,7 +42,7 @@ class DeleteDatabase {
|
|
|
42
42
|
}
|
|
43
43
|
else if (options.where) {
|
|
44
44
|
const { subrc, dbcnt } = await this.context.defaultDB().delete({
|
|
45
|
-
table: (0, prefix_1.
|
|
45
|
+
table: (0, prefix_1.buildDbTableName)(table),
|
|
46
46
|
where: options.where,
|
|
47
47
|
});
|
|
48
48
|
// @ts-ignore
|
|
@@ -49,7 +49,7 @@ class InsertDatabase {
|
|
|
49
49
|
table = table.get().trimEnd().toLowerCase();
|
|
50
50
|
}
|
|
51
51
|
const { subrc, dbcnt } = await this.context.defaultDB().insert({
|
|
52
|
-
table: (0, prefix_1.
|
|
52
|
+
table: (0, prefix_1.buildDbTableName)(table),
|
|
53
53
|
columns,
|
|
54
54
|
values,
|
|
55
55
|
});
|
|
@@ -18,6 +18,9 @@ function replace(input) {
|
|
|
18
18
|
let found = false;
|
|
19
19
|
if (input.of) {
|
|
20
20
|
let inp = input.of.get();
|
|
21
|
+
if (input.of instanceof types_1.Character) {
|
|
22
|
+
inp = input.of.getTrimEnd();
|
|
23
|
+
}
|
|
21
24
|
if (inp.length === 0 && input.all === true) {
|
|
22
25
|
throw "REPLACE, zero length input";
|
|
23
26
|
}
|
|
@@ -44,7 +44,7 @@ class UpdateDatabase {
|
|
|
44
44
|
throw "updateDatabase, todo";
|
|
45
45
|
}
|
|
46
46
|
const { subrc, dbcnt } = await this.context.defaultDB().update({
|
|
47
|
-
table: (0, prefix_1.
|
|
47
|
+
table: (0, prefix_1.buildDbTableName)(table),
|
|
48
48
|
where: where.join(" AND "),
|
|
49
49
|
set,
|
|
50
50
|
});
|