rapidSQL.js
/**
     * Establishes an asynchronous connection to the database.
     */
Establishes an asynchronous connection to the database.
Establishes an asynchronous connection to the database .
connect(){
        return new Promise((resolve, reject) => {
            if(!this.connectionOptions) return reject('No connection options were provided!');
            try{
                this.pool = new mysql.createPool(this.connectionOptions);
                this.pool.getConnection((err, connection) => {
                    if(err){
                        this.pool = null;
                        return reject(err);
                    };
                    connection.release();
                    resolve();
                });
            }catch(error){
                return reject(error);
            };
        });
    }
connect ( ) { return new Promise ( ( resolve , reject ) => { if ( ! this . connectionOptions ) return reject ( 'No connection options were provided!' ) ; try { this . pool = new mysql . createPool ( this . connectionOptions ) ; this . pool . getConnection ( ( err , connection ) => { if ( err ) { this . pool = null ; return reject ( err ) ; } ; connection . release ( ) ; resolve ( ) ; } ) ; } catch ( error ) { return reject ( error ) ; } ; } ) ; }
Establishes an asynchronous connection to the database.
Establishes an asynchronous connection to the database .