MCPcopy Index your code
hub / github.com/brianc/node-postgres / parseRow

Method parseRow

packages/pg/lib/result.js:63–76  ·  view source on GitHub ↗
(rowData)

Source from the content-addressed store, hash-verified

61 }
62
63 parseRow(rowData) {
64 const row = { ...this._prebuiltEmptyResultObject }
65 for (let i = 0, len = rowData.length; i < len; i++) {
66 const rawValue = rowData[i]
67 const field = this.fields[i].name
68 if (rawValue !== null) {
69 const v = this.fields[i].format === 'binary' ? Buffer.from(rawValue) : rawValue
70 row[field] = this._parsers[i](v)
71 } else {
72 row[field] = null
73 }
74 }
75 return row
76 }
77
78 addRow(row) {
79 this.rows.push(row)

Callers 3

handleDataRowMethod · 0.80
handleDataRowMethod · 0.80
result-tests.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected