From 7cc792216e63e0a2332939aae13abb19d3be38c2 Mon Sep 17 00:00:00 2001 From: Diego Date: Thu, 7 May 2020 10:00:39 -0300 Subject: [PATCH] Fix expo sqlite driver disconnect() 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) {