From 61d59ca444e0e9ed10c8e701a1b3d5bed2139fe5 Mon Sep 17 00:00:00 2001 From: Diego Date: Fri, 15 May 2020 01:33:29 -0300 Subject: [PATCH] fix: expo sqlite driver disconnect() (#6027) Currently the disconnect() function does not perform a call to databaseConnection close, it only sets the queryRunner and databaseConnection to undefined, this behavior may cause problems when you do something like this: 1 - await getConnection().close(); 2 - Replace the database file 3 - Try to open connection createConnection(); and do some insert more info: https://github.com/expo/expo/issues/8109 --- src/driver/expo/ExpoDriver.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/expo/ExpoDriver.ts b/src/driver/expo/ExpoDriver.ts index fffd8ffff5..280b7e08b7 100644 --- a/src/driver/expo/ExpoDriver.ts +++ b/src/driver/expo/ExpoDriver.ts @@ -40,6 +40,7 @@ export class ExpoDriver extends AbstractSqliteDriver { return new Promise((ok, fail) => { try { this.queryRunner = undefined; + this.databaseConnection._db.close(); this.databaseConnection = undefined; ok(); } catch (error) {