MCPcopy Create free account
hub / github.com/Seb-C/kiss-orm / insertAndGet

Method insertAndGet

src/Databases/SqliteDatabase.ts:81–97  ·  view source on GitHub ↗
(standardInsertQuery: SqlQuery)

Source from the content-addressed store, hash-verified

79 }
80
81 async insertAndGet(standardInsertQuery: SqlQuery): Promise<number[]|string[]|any[]> {
82 return new Promise((resolve, reject) => {
83 const compiledQuery = standardInsertQuery.compile(this.indexToPlaceholder, formatIdentifier);
84
85 this.connection.run(
86 compiledQuery.sql,
87 <any[]><any>compiledQuery.params,
88 function (error: Error|null) {
89 if (error) {
90 reject(error);
91 } else {
92 resolve([this.lastID]);
93 }
94 },
95 );
96 });
97 }
98
99 async updateAndGet(standardUpdateQuery: SqlQuery): Promise<null|any[]> {
100 await this.query(standardUpdateQuery);

Callers

nothing calls this directly

Calls 1

compileMethod · 0.80

Tested by

no test coverage detected