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

Function execute

cjs/src/connection.js:156–183  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

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