@abaplint/transpiler 2.7.96 → 2.7.97

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.
@@ -27,6 +27,15 @@ class InsertDatabaseTranspiler {
27
27
  const tvalues = traversal.traverse(fromTable);
28
28
  options.push(`"table": ` + tvalues.getCode());
29
29
  }
30
+ const connection = node.findDirectExpression(abaplint.Expressions.DatabaseConnection);
31
+ if (connection) {
32
+ let con = connection.getLastToken().getStr().toUpperCase();
33
+ if (con === "DEFAULT_") {
34
+ // todo, workaround for replacing of keywords,
35
+ con = "DEFAULT";
36
+ }
37
+ options.push(`"connection": "${con}"`);
38
+ }
30
39
  return new chunk_1.Chunk(`await abap.statements.insertDatabase(${table.getCode()}, {${options.join(", ")}});`);
31
40
  }
32
41
  }
@@ -21,15 +21,24 @@ globalThis.abap = new runtime.ABAP();\n`;
21
21
  export async function initializeABAP() {\n`;
22
22
  ret += ` const sqlite = [];\n`;
23
23
  for (const i of dbSetup.schemas.sqlite) {
24
- ret += `sqlite.push(\`${i}\`);\n`;
24
+ ret += ` sqlite.push(\`${i}\`);\n`;
25
25
  }
26
26
  ret += ` const hdb = \`${dbSetup.schemas.hdb}\`;\n`;
27
- ret += ` const pg = \`${dbSetup.schemas.pg}\`;\n`;
28
- ret += ` const schemas = {sqlite, hdb, pg};\n`;
27
+ ret += ` const pg = [];\n`;
28
+ for (const i of dbSetup.schemas.pg) {
29
+ ret += ` pg.push(\`${i}\`);\n`;
30
+ }
31
+ ret += ` const snowflake = [];\n`;
32
+ for (const i of dbSetup.schemas.snowflake) {
33
+ ret += ` snowflake.push(\`${i}\`);\n`;
34
+ }
35
+ ret += ` const schemas = {sqlite, hdb, pg, snowflake};\n`;
36
+ ret += `\n`;
29
37
  ret += ` const insert = [];\n`;
30
38
  for (const i of dbSetup.insert) {
31
39
  ret += ` insert.push(\`${i}\`);\n`;
32
40
  }
41
+ ret += `\n`;
33
42
  if (extraSetup === undefined) {
34
43
  ret += `// no setup logic specified in config\n`;
35
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.7.96",
3
+ "version": "2.7.97",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
- "@abaplint/core": "^2.102.40",
32
+ "@abaplint/core": "^2.102.41",
33
33
  "source-map": "^0.7.4"
34
34
  },
35
35
  "devDependencies": {