Skip to content

Commit

Permalink
fix: expo sqlite driver disconnect() (#6027)
Browse files Browse the repository at this point in the history
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:
expo/expo#8109
  • Loading branch information
allandiego committed May 15, 2020
1 parent e92c743 commit 61d59ca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/driver/expo/ExpoDriver.ts
Expand Up @@ -40,6 +40,7 @@ export class ExpoDriver extends AbstractSqliteDriver {
return new Promise<void>((ok, fail) => {
try {
this.queryRunner = undefined;
this.databaseConnection._db.close();
this.databaseConnection = undefined;
ok();
} catch (error) {
Expand Down

0 comments on commit 61d59ca

Please sign in to comment.