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

Function connected

cjs/src/connection.js:365–379  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363 }
364
365 function connected() {
366 try {
367 statements = {}
368 needsTypes = options.fetch_types
369 statementId = Math.random().toString(36).slice(2)
370 statementCount = 1
371 lifeTimer.start()
372 socket.on('data', data)
373 keep_alive && socket.setKeepAlive && socket.setKeepAlive(true, 1000 * keep_alive)
374 const s = StartupMessage()
375 write(s)
376 } catch (err) {
377 error(err)
378 }
379 }
380
381 function error(err) {
382 if (connection.queue === queues.connecting && options.host[retries + 1])

Callers 2

secureFunction · 0.70
connectFunction · 0.70

Calls 3

StartupMessageFunction · 0.70
writeFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected