MCPcopy Create free account
hub / github.com/abaplint/transpiler / insert

Method insert

packages/database-sqlite/src/index.ts:112–132  ·  view source on GitHub ↗
(options: DB.InsertDatabaseOptions)

Source from the content-addressed store, hash-verified

110 const sql = `UPDATE ${options.table} SET ${options.set.join(", ")} WHERE ${options.where}`;
111
112 let subrc = 0;
113 let dbcnt = 0;
114 try {
115 if (this.trace === true) {
116 console.log(sql);
117 }
118
119 this.sqlite!.exec(sql);
120
121 // https://www.sqlite.org/c3ref/changes.html
122 const chg = this.sqlite!.exec("SELECT changes()");
123 dbcnt = chg[0]["values"][0][0] as number;
124 if (dbcnt === 0) {
125 subrc = 4;
126 }
127 } catch (error) {
128 subrc = 4;
129 }
130
131 return {subrc, dbcnt};
132 }
133
134 public async insert(options: DB.InsertDatabaseOptions) {
135 await this.beginTransaction();

Callers

nothing calls this directly

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected