MCPcopy
hub / github.com/prisma/prisma / start

Method start

packages/query-plan-executor/src/logic/app.ts:45–63  ·  view source on GitHub ↗

* Connects to the database and initializes the application logic.

(options: Options)

Source from the content-addressed store, hash-verified

43 * Connects to the database and initializes the application logic.
44 */
45 static async start(options: Options): Promise<App> {
46 const connector = createAdapter(options.databaseUrl)
47
48 const db = await runInActiveSpan('connect', () => connector.connect())
49
50 const tracingHandler = new TracingHandler(tracer)
51
52 const transactionManager = new TransactionManager({
53 driverAdapter: db,
54 transactionOptions: {
55 timeout: options.maxTransactionTimeout.total('milliseconds'),
56 maxWait: options.maxTransactionWaitTime.total('milliseconds'),
57 },
58 tracingHelper: tracingHandler,
59 onQuery: logQuery,
60 })
61
62 return new App(db, transactionManager, tracingHandler)
63 }
64
65 /**
66 * Cancels all active transactions and disconnects from the database.

Callers

nothing calls this directly

Calls 3

createAdapterFunction · 0.90
runInActiveSpanFunction · 0.90
connectMethod · 0.65

Tested by

no test coverage detected