* Connects to the database and initializes the application logic.
(options: Options)
| 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. |
nothing calls this directly
no test coverage detected