+ try {
+ if (this?.orm) {
+ await this.orm.close();
+ this.orm = null;
+ }
+ } catch (error) {
+ this.handleDBError(this.storageType, error);
+ }
+ }
+
+ private getDBName(): string {
+ if (this.storageType === StorageType.SQLITE) {
+ return `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db`;
+ }
+ return this.storageURI.pathname.replace(/(?:^\/)|(?:\/$)/g, '') ?? Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME;