@abaplint/runtime 1.7.17 → 1.7.21
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/compare/index.d.ts +1 -0
- package/build/src/compare/index.js +1 -0
- package/build/src/compare/np.d.ts +3 -0
- package/build/src/compare/np.js +9 -0
- package/build/src/statements/create_data.d.ts +5 -1
- package/build/src/statements/create_data.js +22 -2
- package/build/src/statements/index.d.ts +4 -2
- package/build/src/statements/index.js +4 -2
- package/build/src/statements/insert_database.d.ts +6 -0
- package/build/src/statements/insert_database.js +30 -0
- package/package.json +42 -42
|
@@ -27,6 +27,7 @@ __exportStar(require("./lt"), exports);
|
|
|
27
27
|
__exportStar(require("./ne"), exports);
|
|
28
28
|
__exportStar(require("./na"), exports);
|
|
29
29
|
__exportStar(require("./ns"), exports);
|
|
30
|
+
__exportStar(require("./np"), exports);
|
|
30
31
|
var in_1 = require("./in");
|
|
31
32
|
Object.defineProperty(exports, "in", { enumerable: true, get: function () { return in_1.compareIn; } });
|
|
32
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { DataReference } from "../types";
|
|
2
|
-
export
|
|
2
|
+
export interface ICreateDataOptions {
|
|
3
|
+
table?: boolean;
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function createData(target: DataReference, options?: ICreateDataOptions): void;
|
|
@@ -2,8 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createData = void 0;
|
|
4
4
|
const clone_1 = require("../clone");
|
|
5
|
-
function createData(target) {
|
|
6
|
-
|
|
5
|
+
function createData(target, options) {
|
|
6
|
+
if ((options === null || options === void 0 ? void 0 : options.name) && (options === null || options === void 0 ? void 0 : options.table)) {
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
if (abap.DDIC[options.name] === undefined) {
|
|
9
|
+
// todo, throw exception
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
target.assign(new abap.types.Table(abap.DDIC[options.name].type));
|
|
14
|
+
}
|
|
15
|
+
else if (options === null || options === void 0 ? void 0 : options.name) {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
if (abap.DDIC[options.name] === undefined) {
|
|
18
|
+
// todo, throw exception
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
target.assign((0, clone_1.clone)(abap.DDIC[options.name].type));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
target.assign((0, clone_1.clone)(target.getType()));
|
|
26
|
+
}
|
|
7
27
|
}
|
|
8
28
|
exports.createData = createData;
|
|
9
29
|
//# sourceMappingURL=create_data.js.map
|
|
@@ -7,13 +7,14 @@ import { concatenate } from "./concatenate";
|
|
|
7
7
|
import { condense } from "./condense";
|
|
8
8
|
import { Console } from "../console";
|
|
9
9
|
import { convert } from "./convert";
|
|
10
|
+
import { createData } from "./create_data";
|
|
10
11
|
import { deleteInternal } from "./delete_internal";
|
|
11
12
|
import { describe } from "./describe";
|
|
12
13
|
import { find } from "./find";
|
|
13
|
-
import { createData } from "./create_data";
|
|
14
|
-
import { getRunTime } from "./get_run_time";
|
|
15
14
|
import { getBit } from "./get_bit";
|
|
15
|
+
import { getRunTime } from "./get_run_time";
|
|
16
16
|
import { getTime } from "./get_time";
|
|
17
|
+
import { insertDatabase } from "./insert_database";
|
|
17
18
|
import { insertInternal } from "./insert_internal";
|
|
18
19
|
import { loop } from "./loop";
|
|
19
20
|
import { message } from "./message";
|
|
@@ -45,6 +46,7 @@ export declare class Statements {
|
|
|
45
46
|
getBit: typeof getBit;
|
|
46
47
|
getRunTime: typeof getRunTime;
|
|
47
48
|
getTime: typeof getTime;
|
|
49
|
+
insertDatabase: typeof insertDatabase;
|
|
48
50
|
insertInternal: typeof insertInternal;
|
|
49
51
|
loop: typeof loop;
|
|
50
52
|
message: typeof message;
|
|
@@ -9,13 +9,14 @@ const commit_1 = require("./commit");
|
|
|
9
9
|
const concatenate_1 = require("./concatenate");
|
|
10
10
|
const condense_1 = require("./condense");
|
|
11
11
|
const convert_1 = require("./convert");
|
|
12
|
+
const create_data_1 = require("./create_data");
|
|
12
13
|
const delete_internal_1 = require("./delete_internal");
|
|
13
14
|
const describe_1 = require("./describe");
|
|
14
15
|
const find_1 = require("./find");
|
|
15
|
-
const create_data_1 = require("./create_data");
|
|
16
|
-
const get_run_time_1 = require("./get_run_time");
|
|
17
16
|
const get_bit_1 = require("./get_bit");
|
|
17
|
+
const get_run_time_1 = require("./get_run_time");
|
|
18
18
|
const get_time_1 = require("./get_time");
|
|
19
|
+
const insert_database_1 = require("./insert_database");
|
|
19
20
|
const insert_internal_1 = require("./insert_internal");
|
|
20
21
|
const loop_1 = require("./loop");
|
|
21
22
|
const message_1 = require("./message");
|
|
@@ -50,6 +51,7 @@ class Statements {
|
|
|
50
51
|
this.getBit = get_bit_1.getBit;
|
|
51
52
|
this.getRunTime = get_run_time_1.getRunTime;
|
|
52
53
|
this.getTime = get_time_1.getTime;
|
|
54
|
+
this.insertDatabase = insert_database_1.insertDatabase;
|
|
53
55
|
this.insertInternal = insert_internal_1.insertInternal;
|
|
54
56
|
this.loop = loop_1.loop;
|
|
55
57
|
this.message = message_1.message;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.insertDatabase = void 0;
|
|
4
|
+
function insertDatabase(table, options) {
|
|
5
|
+
if (this.db === undefined) {
|
|
6
|
+
throw new Error("Runtime, database not initialized");
|
|
7
|
+
}
|
|
8
|
+
const columns = [];
|
|
9
|
+
const values = [];
|
|
10
|
+
const structure = options.values.get();
|
|
11
|
+
for (const k of Object.keys(structure)) {
|
|
12
|
+
columns.push(k);
|
|
13
|
+
// todo, integers should not be surrounded by '"'?
|
|
14
|
+
values.push('"' + structure[k].get() + '"');
|
|
15
|
+
}
|
|
16
|
+
const sql = `INSERT INTO ${table} (${columns.join(",")}) VALUES (${values.join(",")})`;
|
|
17
|
+
// console.dir(sql);
|
|
18
|
+
try {
|
|
19
|
+
this.db.exec(sql);
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
// eg "UNIQUE constraint failed" errors
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.insertDatabase = insertDatabase;
|
|
30
|
+
//# sourceMappingURL=insert_database.js.map
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "Transpiler - Runtime",
|
|
5
|
-
"main": "build/src/index.js",
|
|
6
|
-
"typings": "build/src/index.d.ts",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"compile": "tsc",
|
|
13
|
-
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
14
|
-
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
15
|
-
"test": "npm run compile && mocha"
|
|
16
|
-
},
|
|
17
|
-
"mocha": {
|
|
18
|
-
"recursive": true,
|
|
19
|
-
"reporter": "progress",
|
|
20
|
-
"spec": "build/test/**/*.js",
|
|
21
|
-
"require": "source-map-support/register"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"ABAP",
|
|
25
|
-
"abaplint"
|
|
26
|
-
],
|
|
27
|
-
"author": "abaplint",
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"hdb": "^0.19.1",
|
|
31
|
-
"sql.js": "^1.6.2"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@types/chai": "^4.3.0",
|
|
35
|
-
"@types/mocha": "^9.0.0",
|
|
36
|
-
"@types/sql.js": "^1.4.3",
|
|
37
|
-
"chai": "^4.3.4",
|
|
38
|
-
"mocha": "^9.1.4",
|
|
39
|
-
"source-map-support": "^0.5.21",
|
|
40
|
-
"typescript": "^4.5.4"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@abaplint/runtime",
|
|
3
|
+
"version": "1.7.21",
|
|
4
|
+
"description": "Transpiler - Runtime",
|
|
5
|
+
"main": "build/src/index.js",
|
|
6
|
+
"typings": "build/src/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"compile": "tsc",
|
|
13
|
+
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
14
|
+
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
15
|
+
"test": "npm run compile && mocha"
|
|
16
|
+
},
|
|
17
|
+
"mocha": {
|
|
18
|
+
"recursive": true,
|
|
19
|
+
"reporter": "progress",
|
|
20
|
+
"spec": "build/test/**/*.js",
|
|
21
|
+
"require": "source-map-support/register"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"ABAP",
|
|
25
|
+
"abaplint"
|
|
26
|
+
],
|
|
27
|
+
"author": "abaplint",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"hdb": "^0.19.1",
|
|
31
|
+
"sql.js": "^1.6.2"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/chai": "^4.3.0",
|
|
35
|
+
"@types/mocha": "^9.0.0",
|
|
36
|
+
"@types/sql.js": "^1.4.3",
|
|
37
|
+
"chai": "^4.3.4",
|
|
38
|
+
"mocha": "^9.1.4",
|
|
39
|
+
"source-map-support": "^0.5.21",
|
|
40
|
+
"typescript": "^4.5.4"
|
|
41
|
+
}
|
|
42
|
+
}
|