openDB(onUpgrade = null) {
    let request = window.indexedDB.open(this.dbname, this.version);

    return new Promise((resolve, reject) => {
      //handle successful database opening
      request.onsuccess = event => {
        console.log('idb:odb:os');
        this.db = event.target.result;
        resolve(this);
      };

      //handle errors on database opening
      request.onerror = event => {
        let error = event.target.error;
        console.error('idb:odb:oe::', error);
        reject(error);
      };

      request.onblocked = event => {
        console.log('idb:odb:ob::', event);
      };

      //if provided, allow for database upgrading
      if (onUpgrade) {
        request.onupgradeneeded = event => {
          console.log('idb:odb:oun');
          this.upgraded = true;
          this.db = event.target.result;
          this.oldVersion = event.oldVersion;
          onUpgrade(this);
        };
      }
    });
  }
/**
   * [open_db attempts to open the database for use]
   * @param  {Function} [onUpgrade=null] [callback that is used when IndexedDB requires an upgrade]
   * @return {Promise<IDB>} [a Promise resolving upon successful database opening or rejecting on error]
   */
[open_db attempts to open the database for use]
@param  {Function} [onUpgrade=null] [callback that is used when IndexedDB requires an upgrade]
@return {Promise} [a Promise resolving upon successful database opening or rejecting on error]
[ open_db attempts to open the database for use ] @param { Function } [ onUpgrade = null ] [ callback that is used when IndexedDB requires an upgrade ] @return { Promise } [ a Promise resolving upon successful database opening or rejecting on error ]
openDB(onUpgrade = null) {
    let request = window.indexedDB.open(this.dbname, this.version);
    return new Promise((resolve, reject) => {
      request.onsuccess = event => {
        console.log('idb:odb:os');
        this.db = event.target.result;
        resolve(this);
      };
      request.onerror = event => {
        let error = event.target.error;
        console.error('idb:odb:oe::', error);
        reject(error);
      };
      request.onblocked = event => {
        console.log('idb:odb:ob::', event);
      };
      if (onUpgrade) {
        request.onupgradeneeded = event => {
          console.log('idb:odb:oun');
          this.upgraded = true;
          this.db = event.target.result;
          this.oldVersion = event.oldVersion;
          onUpgrade(this);
        };
      }
    });
  }
openDB ( onUpgrade = null ) { let request = window . indexedDB . open ( this . dbname , this . version ) ; return new Promise ( ( resolve , reject ) => { request . onsuccess = event => { console . log ( 'idb:odb:os' ) ; this . db = event . target . result ; resolve ( this ) ; } ; request . onerror = event => { let error = event . target . error ; console . error ( 'idb:odb:oe::' , error ) ; reject ( error ) ; } ; request . onblocked = event => { console . log ( 'idb:odb:ob::' , event ) ; } ; if ( onUpgrade ) { request . onupgradeneeded = event => { console . log ( 'idb:odb:oun' ) ; this . upgraded = true ; this . db = event . target . result ; this . oldVersion = event . oldVersion ; onUpgrade ( this ) ; } ; } } ) ; }
[open_db attempts to open the database for use]
 @param  {Function} [onUpgrade=null] [callback that is used when IndexedDB requires an upgrade]
 @return {Promise<IDB>} [a Promise resolving upon successful database opening or rejecting on error]
[ open_db attempts to open the database for use ] @param { Function } [ onUpgrade = null ] [ callback that is used when IndexedDB requires an upgrade ] @return { Promise<IDB > } [ a Promise resolving upon successful database opening or rejecting on error ]
//handle successful database opening //handle errors on database opening //if provided, allow for database upgrading