MCPcopy Create free account
hub / github.com/porsager/postgres / RowDescription

Function RowDescription

cjs/src/connection.js:636–671  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

634 }
635
636 function RowDescription(x) {
637 if (result.command) {
638 results = results || [result]
639 results.push(result = new Result())
640 result.count = null
641 query.statement.columns = null
642 }
643
644 const length = x.readUInt16BE(5)
645 let index = 7
646 let start
647
648 query.statement.columns = Array(length)
649
650 for (let i = 0; i < length; ++i) {
651 start = index
652 while (x[index++] !== 0);
653 const table = x.readUInt32BE(index)
654 const number = x.readUInt16BE(index + 4)
655 const type = x.readUInt32BE(index + 6)
656 query.statement.columns[i] = {
657 name: transform.column.from
658 ? transform.column.from(x.toString('utf8', start, index - 1))
659 : x.toString('utf8', start, index - 1),
660 parser: parsers[type],
661 table,
662 number,
663 type
664 }
665 index += 18
666 }
667
668 result.statement = query.statement
669 if (query.onlyDescribe)
670 return (query.resolve(query.statement), write(Sync))
671 }
672
673 async function Authentication(x, type = x.readUInt32BE(5)) {
674 (

Callers

nothing calls this directly

Calls 1

writeFunction · 0.70

Tested by

no test coverage detected