@abaplint/transpiler 2.1.27 → 2.1.28
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/db/index.js
CHANGED
|
@@ -12,26 +12,27 @@ class DatabaseSetup {
|
|
|
12
12
|
return {
|
|
13
13
|
schemas: {
|
|
14
14
|
sqlite: new sqlite_database_schema_1.SQLiteDatabaseSchema(this.reg).run(),
|
|
15
|
-
hdb: "todo",
|
|
16
|
-
pg: "todo",
|
|
15
|
+
hdb: ["todo"],
|
|
16
|
+
pg: ["todo"],
|
|
17
17
|
},
|
|
18
18
|
insert: this.buildInsert(),
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
////////////////////
|
|
22
22
|
buildInsert() {
|
|
23
|
-
|
|
23
|
+
// note: avoid hitting maximum statement size by splitting into multiple statements
|
|
24
|
+
const insert = [];
|
|
24
25
|
// INSERT data
|
|
25
26
|
for (const obj of this.reg.getObjects()) {
|
|
26
27
|
if (obj instanceof abaplint.Objects.MessageClass) {
|
|
27
|
-
insert
|
|
28
|
+
insert.push(this.insertT100(obj));
|
|
28
29
|
}
|
|
29
30
|
else if (obj instanceof abaplint.Objects.Class
|
|
30
31
|
|| obj instanceof abaplint.Objects.Interface) {
|
|
31
|
-
insert
|
|
32
|
+
insert.push(this.insertREPOSRC(obj));
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
insert
|
|
35
|
+
insert.push(this.insertT000());
|
|
35
36
|
return insert;
|
|
36
37
|
}
|
|
37
38
|
insertREPOSRC(obj) {
|
|
@@ -7,14 +7,15 @@ class SQLiteDatabaseSchema {
|
|
|
7
7
|
this.reg = reg;
|
|
8
8
|
}
|
|
9
9
|
run() {
|
|
10
|
-
|
|
10
|
+
const statements = [];
|
|
11
11
|
// CREATE TABLEs
|
|
12
12
|
for (const obj of this.reg.getObjects()) {
|
|
13
|
-
if (obj instanceof abaplint.Objects.Table
|
|
14
|
-
|
|
13
|
+
if (obj instanceof abaplint.Objects.Table
|
|
14
|
+
&& obj.getTableCategory() === abaplint.Objects.TableCategory.Transparent) {
|
|
15
|
+
statements.push(this.transparentTable(obj).trim());
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
return
|
|
18
|
+
return statements;
|
|
18
19
|
}
|
|
19
20
|
//////////////////
|
|
20
21
|
transparentTable(tabl) {
|
package/build/src/unit_test.js
CHANGED
|
@@ -23,7 +23,10 @@ export async function initializeABAP() {\n`;
|
|
|
23
23
|
ret += ` const hdb = \`${dbSetup.schemas.hdb}\`;\n`;
|
|
24
24
|
ret += ` const pg = \`${dbSetup.schemas.pg}\`;\n`;
|
|
25
25
|
ret += ` const schemas = {sqlite, hdb, pg};\n`;
|
|
26
|
-
ret += ` const insert =
|
|
26
|
+
ret += ` const insert = [];\n`;
|
|
27
|
+
for (const i of dbSetup.insert) {
|
|
28
|
+
ret += `insert.push(\`${i}\`);\n`;
|
|
29
|
+
}
|
|
27
30
|
if (extraSetup === undefined) {
|
|
28
31
|
ret += `// no setup logic specified in config\n`;
|
|
29
32
|
}
|