MCPcopy Create free account
hub / github.com/denodrivers/postgres / insertRow

Method insertRow

query/query.ts:246–264  ·  view source on GitHub ↗

* Insert a row into the result

(row_data: Uint8Array[], controls?: ClientControls)

Source from the content-addressed store, hash-verified

244 * Insert a row into the result
245 */
246 insertRow(row_data: Uint8Array[], controls?: ClientControls) {
247 if (!this.rowDescription) {
248 throw new Error(
249 "The row descriptions required to parse the result data weren't initialized",
250 );
251 }
252
253 // Row description won't be modified after initialization
254 const row = row_data.map((raw_value, index) => {
255 const column = this.rowDescription!.columns[index];
256
257 if (raw_value === null) {
258 return null;
259 }
260 return decode(raw_value, column, controls);
261 }) as T;
262
263 this.rows.push(row);
264 }
265}
266
267function findDuplicatesInArray(array: string[]): string[] {

Callers 2

#simpleQueryMethod · 0.45
#preparedQueryMethod · 0.45

Calls 2

decodeFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected