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

Function execute

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

Source from the content-addressed store, hash-verified

156 }
157
158 function execute(q) {
159 if (terminated)
160 return queryError(q, Errors.connection('CONNECTION_DESTROYED', options))
161
162 if (stream)
163 return queryError(q, Errors.generic('COPY_IN_PROGRESS', 'You cannot execute queries during copy'))
164
165 if (q.cancelled)
166 return
167
168 try {
169 q.state = backend
170 query
171 ? sent.push(q)
172 : (query = q, query.active = true)
173
174 build(q)
175 return write(toBuffer(q))
176 && !q.describeFirst
177 && !q.cursorFn
178 && sent.length < max_pipeline
179 && (!q.options.onexecute || q.options.onexecute(connection))
180 } catch (error) {
181 sent.length === 0 && write(Sync)
182 errored(error)
183 return true
184 }
185 }
186
187 function toBuffer(q) {
188 if (q.parameters.length >= 65534)

Callers 2

ReadyForQueryFunction · 0.70
retryFunction · 0.70

Calls 5

queryErrorFunction · 0.70
buildFunction · 0.70
writeFunction · 0.70
toBufferFunction · 0.70
erroredFunction · 0.70

Tested by

no test coverage detected