@abaplint/runtime 2.7.70 → 2.7.72
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/builtin/sy.js +1 -0
- package/build/src/prefix.d.ts +1 -0
- package/build/src/prefix.js +10 -0
- package/build/src/statements/delete_database.js +9 -2
- package/build/src/statements/insert_database.js +6 -1
- package/build/src/statements/update_database.js +6 -1
- package/build/src/types/structure.d.ts +9 -3
- package/build/src/types/structure.js +7 -3
- package/package.json +1 -1
package/build/src/builtin/sy.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function prefixDbTable(table: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prefixDbTable = void 0;
|
|
4
|
+
function prefixDbTable(table) {
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
const prefix = abap.dbo.schemaPrefix + abap.dbo.tablePrefix;
|
|
7
|
+
return prefix + table;
|
|
8
|
+
}
|
|
9
|
+
exports.prefixDbTable = prefixDbTable;
|
|
10
|
+
//# sourceMappingURL=prefix.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeleteDatabase = void 0;
|
|
4
|
+
const prefix_1 = require("../prefix");
|
|
4
5
|
const types_1 = require("../types");
|
|
5
6
|
const insert_database_1 = require("./insert_database");
|
|
6
7
|
class DeleteDatabase {
|
|
@@ -30,14 +31,20 @@ class DeleteDatabase {
|
|
|
30
31
|
where.push(str);
|
|
31
32
|
}
|
|
32
33
|
where = where.join(" AND ");
|
|
33
|
-
const { subrc, dbcnt } = await this.context.defaultDB().delete({
|
|
34
|
+
const { subrc, dbcnt } = await this.context.defaultDB().delete({
|
|
35
|
+
table: (0, prefix_1.prefixDbTable)(table),
|
|
36
|
+
where,
|
|
37
|
+
});
|
|
34
38
|
// @ts-ignore
|
|
35
39
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
36
40
|
// @ts-ignore
|
|
37
41
|
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
38
42
|
}
|
|
39
43
|
else if (options.where) {
|
|
40
|
-
const { subrc, dbcnt } = await this.context.defaultDB().delete({
|
|
44
|
+
const { subrc, dbcnt } = await this.context.defaultDB().delete({
|
|
45
|
+
table: (0, prefix_1.prefixDbTable)(table),
|
|
46
|
+
where: options.where,
|
|
47
|
+
});
|
|
41
48
|
// @ts-ignore
|
|
42
49
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
43
50
|
// @ts-ignore
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InsertDatabase = exports.toValue = void 0;
|
|
4
|
+
const prefix_1 = require("../prefix");
|
|
4
5
|
function toValue(value) {
|
|
5
6
|
if (typeof value === "string") {
|
|
6
7
|
// postgres requires ' for values
|
|
@@ -47,7 +48,11 @@ class InsertDatabase {
|
|
|
47
48
|
if (typeof table !== "string") {
|
|
48
49
|
table = table.get().trimEnd().toLowerCase();
|
|
49
50
|
}
|
|
50
|
-
const { subrc, dbcnt } = await this.context.defaultDB().insert({
|
|
51
|
+
const { subrc, dbcnt } = await this.context.defaultDB().insert({
|
|
52
|
+
table: (0, prefix_1.prefixDbTable)(table),
|
|
53
|
+
columns,
|
|
54
|
+
values,
|
|
55
|
+
});
|
|
51
56
|
// @ts-ignore
|
|
52
57
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
53
58
|
// @ts-ignore
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateDatabase = void 0;
|
|
4
|
+
const prefix_1 = require("../prefix");
|
|
4
5
|
const types_1 = require("../types");
|
|
5
6
|
const insert_database_1 = require("./insert_database");
|
|
6
7
|
class UpdateDatabase {
|
|
@@ -42,7 +43,11 @@ class UpdateDatabase {
|
|
|
42
43
|
else {
|
|
43
44
|
throw "updateDatabase, todo";
|
|
44
45
|
}
|
|
45
|
-
const { subrc, dbcnt } = await this.context.defaultDB().update({
|
|
46
|
+
const { subrc, dbcnt } = await this.context.defaultDB().update({
|
|
47
|
+
table: (0, prefix_1.prefixDbTable)(table),
|
|
48
|
+
where: where.join(" AND "),
|
|
49
|
+
set,
|
|
50
|
+
});
|
|
46
51
|
// @ts-ignore
|
|
47
52
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
48
53
|
// @ts-ignore
|
|
@@ -8,11 +8,17 @@ export declare class Structure {
|
|
|
8
8
|
private readonly value;
|
|
9
9
|
private readonly qualifiedName;
|
|
10
10
|
private readonly ddicName;
|
|
11
|
-
private readonly
|
|
12
|
-
|
|
11
|
+
private readonly suffix;
|
|
12
|
+
private readonly asInclude;
|
|
13
|
+
constructor(fields: any, qualifiedName?: string, ddicName?: string, suffix?: any, asInclude?: any);
|
|
13
14
|
clear(): this;
|
|
14
15
|
getDDICName(): string | undefined;
|
|
15
|
-
getRenamingSuffix():
|
|
16
|
+
getRenamingSuffix(): {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
getAsInclude(): {
|
|
20
|
+
[key: string]: boolean;
|
|
21
|
+
};
|
|
16
22
|
getQualifiedName(): string | undefined;
|
|
17
23
|
set(input: Structure | string | INumeric | Table | ICharacter | FieldSymbol | undefined): this | undefined;
|
|
18
24
|
private setCharacter;
|
|
@@ -8,11 +8,12 @@ const _parse_1 = require("../operators/_parse");
|
|
|
8
8
|
const character_1 = require("./character");
|
|
9
9
|
const throw_error_1 = require("../throw_error");
|
|
10
10
|
class Structure {
|
|
11
|
-
constructor(fields, qualifiedName, ddicName,
|
|
11
|
+
constructor(fields, qualifiedName, ddicName, suffix, asInclude) {
|
|
12
12
|
this.value = fields;
|
|
13
13
|
this.qualifiedName = qualifiedName === null || qualifiedName === void 0 ? void 0 : qualifiedName.toUpperCase();
|
|
14
14
|
this.ddicName = ddicName === null || ddicName === void 0 ? void 0 : ddicName.toUpperCase();
|
|
15
|
-
this.
|
|
15
|
+
this.suffix = suffix;
|
|
16
|
+
this.asInclude = asInclude;
|
|
16
17
|
}
|
|
17
18
|
clear() {
|
|
18
19
|
for (const f in this.value) {
|
|
@@ -25,7 +26,10 @@ class Structure {
|
|
|
25
26
|
return this.ddicName;
|
|
26
27
|
}
|
|
27
28
|
getRenamingSuffix() {
|
|
28
|
-
return this.
|
|
29
|
+
return this.suffix;
|
|
30
|
+
}
|
|
31
|
+
getAsInclude() {
|
|
32
|
+
return this.asInclude;
|
|
29
33
|
}
|
|
30
34
|
getQualifiedName() {
|
|
31
35
|
return this.qualifiedName;
|