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

Method insertAndGet

src/Databases/MySqlDatabase.ts:112–128  ·  view source on GitHub ↗
(standardInsertQuery: SqlQuery)

Source from the content-addressed store, hash-verified

110 }
111
112 async insertAndGet(standardInsertQuery: SqlQuery): Promise<number[]|string[]|any[]> {
113 return new Promise((resolve, reject) => {
114 const compiledQuery = standardInsertQuery.compile(this.indexToPlaceholder, formatIdentifier);
115
116 this.connection.query(
117 compiledQuery.sql,
118 <any[]><any>compiledQuery.params,
119 (error, { insertId }) => {
120 if (error) {
121 reject(error);
122 } else {
123 resolve([insertId]);
124 }
125 },
126 );
127 });
128 }
129
130 async updateAndGet(standardUpdateQuery: SqlQuery): Promise<null|any[]> {
131 await this.query(standardUpdateQuery);

Callers

nothing calls this directly

Calls 2

compileMethod · 0.80
queryMethod · 0.65

Tested by

no test coverage detected