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

Function toBuffer

cf/src/connection.js:187–200  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

185 }
186
187 function toBuffer(q) {
188 if (q.parameters.length >= 65534)
189 throw Errors.generic('MAX_PARAMETERS_EXCEEDED', 'Max number of parameters (65534) exceeded')
190
191 return q.options.simple
192 ? b().Q().str(q.statement.string + b.N).end()
193 : q.describeFirst
194 ? Buffer.concat([describe(q), Flush])
195 : q.prepare
196 ? q.prepared
197 ? prepared(q)
198 : Buffer.concat([describe(q), prepared(q)])
199 : unnamed(q)
200 }
201
202 function describe(q) {
203 return Buffer.concat([

Callers 1

executeFunction · 0.70

Calls 4

describeFunction · 0.70
preparedFunction · 0.70
unnamedFunction · 0.70
endMethod · 0.65

Tested by

no test coverage detected