MCPcopy
hub / github.com/prisma/prisma / $disconnect

Method $disconnect

packages/client/src/runtime/getPrismaClient.ts:523–536  ·  view source on GitHub ↗

* Disconnect from the database

()

Source from the content-addressed store, hash-verified

521 * Disconnect from the database
522 */
523 async $disconnect() {
524 try {
525 await this._engine.stop()
526 } catch (e: any) {
527 e.clientVersion = this._clientVersion
528 throw e
529 } finally {
530 // Debug module keeps a list of last 100 logs regardless of environment
531 // variables. This can cause a memory leak. It's especially bad in jest
532 // environment where keeping an error in this list prevents jest sandbox
533 // from being GCed. Clearing logs on disconnect helps to avoid that
534 clearLogs()
535 }
536 }
537
538 /**
539 * Executes a raw query and always returns a number

Callers 15

mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
setupTestSuiteMatrixFunction · 0.95
mainFunction · 0.95
smokeTestFunction · 0.95
mainFunction · 0.95
teardownScenarioFunction · 0.80
test.tsFile · 0.80
test.tsFile · 0.80

Calls 2

clearLogsFunction · 0.90
stopMethod · 0.65

Tested by 9

mainFunction · 0.76
mainFunction · 0.76
mainFunction · 0.76
mainFunction · 0.76
mainFunction · 0.76
mainFunction · 0.76
teardownScenarioFunction · 0.64
runFunction · 0.64
cleanupFunction · 0.64