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

Function RowDescription

cf/src/connection.js:638–673  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

writeFunction · 0.70

Tested by

no test coverage detected