@abaplint/runtime 2.7.71 → 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.
|
@@ -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
|