@abaplint/runtime 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.
@@ -5,5 +5,6 @@ export declare function toValue(value: any): any;
5
5
  export interface IInsertDatabaseOptions {
6
6
  values?: Structure;
7
7
  table?: Table;
8
+ connection?: string;
8
9
  }
9
10
  export declare function insertDatabase(table: string | ICharacter, options: IInsertDatabaseOptions, context: Context): Promise<number | undefined>;
@@ -23,7 +23,7 @@ async function insertDatabase(table, options, context) {
23
23
  let subrc = 0;
24
24
  let dbcnt = 0;
25
25
  for (const row of options.table.array()) {
26
- await insertDatabase(table, { values: row }, context);
26
+ await insertDatabase(table, { values: row, connection: options.connection }, context);
27
27
  // @ts-ignore
28
28
  subrc = Math.max(subrc, abap.builtin.sy.get().subrc.get());
29
29
  // @ts-ignore
@@ -44,7 +44,11 @@ async function insertDatabase(table, options, context) {
44
44
  if (typeof table !== "string") {
45
45
  table = table.get().trimEnd().toLowerCase();
46
46
  }
47
- const { subrc, dbcnt } = await context.defaultDB().insert({
47
+ let db = context.defaultDB();
48
+ if (options.connection) {
49
+ db = context.databaseConnections[options.connection];
50
+ }
51
+ const { subrc, dbcnt } = await db.insert({
48
52
  table: (0, prefix_1.buildDbTableName)(table),
49
53
  columns,
50
54
  values,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.96",
3
+ "version": "2.7.97",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",