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

Function RowDescription

deno/src/connection.js:639–674  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

writeFunction · 0.70

Tested by

no test coverage detected