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

Function execute

deno/src/connection.js:159–186  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

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