* Disconnect from the database
()
| 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 |