{"size": 1498, "ext": "js", "max_stars_repo_path": "src/models/descriptions.model.js", "max_stars_repo_name": "albertferreira2020/MVC-Login-JWT-Template", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/models/descriptions.model.js", "max_issues_repo_name": "albertferreira2020/MVC-Login-JWT-Template", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/models/descriptions.model.js", "max_forks_repo_name": "albertferreira2020/MVC-Login-JWT-Template", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.2432432432, "max_line_length": 98, "alphanum_fraction": 0.5066755674}
const fileconfig  = require('../config'); 
var oracledb = require('oracledb');  
 


function descriptionclients (id, inicio, fim, callback) {
  
  let promise = new Promise(function(resolve, reject) {
 
    oracledb.getConnection(fileconfig.configoracle, function(err, connection){
    if (err) { 
    console.error('erro de conexão' + err);

    connection.close(function(err) {
      if (err) {
        console.log('Error closing connection', err);
      } else {
        //console.log('Connection closed');
      }
    });

    resolve(callback(err, null))
    }else{

 
  
querysql = `
        Select * from xxxx
      `  
        connection.execute(querysql , {}, { outFormat: oracledb.OBJECT },function(err, recordset){

        if (err) { 
          console.error(err);

          connection.close(function(err) {
            if (err) {
              console.log('Error closing connection', err);
            } else {
              //console.log('Connection closed');
            }
          });

          resolve(callback(err, null))
        }else{


          connection.close(function(err) {
            if (err) {
              console.log('Error closing connection', err);
            } else {
              //console.log('Connection closed');
            }
          });


           resolve(callback(null, recordset))
      }
         
         
      });



      }
      ///////////////
      });


    //////////////fecha callback
    });

}

module.exports = descriptionclients;