dist/packages/partitioning-adapter/lokidb.partitioning-adapter.js
/**
     * Loads a database which was partitioned into several key/value saves.
     * (Loki persistence adapter interface function)
     *
     * @param {string} dbname - name of the database (filename/keyname)
     * @returns {Promise} a Promise that resolves after the database was loaded
     */
Loads a database which was partitioned into several key/value saves.
(Loki persistence adapter interface function)

@param {string} dbname - name of the database (filename/keyname)
@returns {Promise} a Promise that resolves after the database was loaded
Loads a database which was partitioned into several key / value saves . ( Loki persistence adapter interface function ) @param { string } dbname - name of the database ( filename / keyname ) @returns { Promise } a Promise that resolves after the database was loaded
loadDatabase(dbname) {
        this._dbname = dbname;
        this._dbref = new loki_["Loki"](dbname);
        return this._adapter.loadDatabase(dbname).then((result) => {
            if (typeof result !== "string") {
                throw new Error("LokiPartitioningAdapter received an unexpected response from inner adapter loadDatabase()");
            }
            let db = JSON.parse(result);
            this._dbref.loadJSONObject(db);
            db = null;
            if (this._dbref._collections.length === 0) {
                return this._dbref;
            }
            this._pageIterator = {
                collection: 0,
                pageIndex: 0
            };
            return this._loadNextPartition(0).then(() => this._dbref);
        });
    }
loadDatabase ( dbname ) { this . _dbname = dbname ; this . _dbref = new loki_ [ "Loki" ] ( dbname ) ; return this . _adapter . loadDatabase ( dbname ) . then ( ( result ) => { if ( typeof result !== "string" ) { throw new Error ( "LokiPartitioningAdapter received an unexpected response from inner adapter loadDatabase()" ) ; } let db = JSON . parse ( result ) ; this . _dbref . loadJSONObject ( db ) ; db = null ; if ( this . _dbref . _collections . length === 0 ) { return this . _dbref ; } this . _pageIterator = { collection : 0 , pageIndex : 0 } ; return this . _loadNextPartition ( 0 ) . then ( ( ) => this . _dbref ) ; } ) ; }
Loads a database which was partitioned into several key/value saves.
Loads a database which was partitioned into several key / value saves .
// load the db container (without data) // I will want to use loki destructuring helper methods so i will inflate into typed instance