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

Method $on

packages/client/src/runtime/getPrismaClient.ts:502–509  ·  view source on GitHub ↗
(eventType: E, callback: EventCallback<E>)

Source from the content-addressed store, hash-verified

500 }
501
502 $on<E extends ExtendedEventType>(eventType: E, callback: EventCallback<E>): PrismaClient {
503 if (eventType === 'beforeExit') {
504 this._engine.onBeforeExit(callback as EventCallback<'beforeExit'>)
505 } else if (eventType) {
506 this._engineConfig.logEmitter.on(eventType, callback as EventCallback<LogLevel>)
507 }
508 return this
509 }
510
511 $connect() {
512 try {

Callers 15

constructorMethod · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
test.tsFile · 0.80
test.tsFile · 0.80
index.tsFile · 0.80
index.tsFile · 0.80
index.tsFile · 0.80
index.tsFile · 0.80
tests.tsFile · 0.80

Calls 2

onBeforeExitMethod · 0.65
onMethod · 0.65

Tested by 4

mainFunction · 0.76
mainFunction · 0.76
mainFunction · 0.76
mainFunction · 0.76