<commit_before>var express = require('express');
var router = express.Router();
var mysql = require('mysql');
var utils = require('../utils');
var connectionpool = mysql.createPool({
        host     : 'localhost',
        user     : 'root',
        password : <PASSWORD>,
        database : 'backup'
    });



router.get('/base', function(req,res){
    var query = 'SELECT name,description,start_date FROM tournament_tournaments WHERE start_date > now() ORDER BY start_date ASC';
    utils.runQuery(connectionpool, query, req, res, doStuff);
});

function doStuff(res) {
    console.log(res);
}

router.get('/base/:id', function(req, res) {
    var query = 'SELECT name, description, amount, cash_prize, discount, status, start_date, end_date FROM tournament_tournaments WHERE id=' + req.params.id;
    utils.runQuery(connectionpool, query, req, res, doStuff);
});

module.exports = router;<commit_msg>added better tournament query<commit_after>var express = require('express');
var router = express.Router();
var mysql = require('mysql');
var utils = require('../utils');
var connectionpool = mysql.createPool({
        host     : 'localhost',
        user     : 'root',
        password : <PASSWORD>,
        database : 'backup'
    });

var queryString = 
'SELECT tournament_events.date_play, \
    tournament_events.start_time, \
    tournament_events.end_time, \
    tournament_events.round_times, \
    tournament_sites.name, \
    tournament_sites.description, \
    tournament_sites.address, \
    tournament_sites.city, \
    tournament_sites.state, \
    tournament_sites.zip, \
    tournament_sections.name, \
    tournament_sections.rating_min, \
    tournament_sections.rating_max, \
    tournament_sections.grade_min, \
    tournament_sections.grade_max, \
    tournament_sections.rounds, \
    tournament_sections.prizes, \
    tournament_sections.prize_team \
FROM \
    tournament_sites \
INNER JOIN tournament_events ON tournament_events.sites_id=tournament_sites.id \
INNER JOIN tournament_sections ON tournament_sections.id=tournament_events.sections_id \
WHERE tournament_events.id=';

router.get('/base', function(req,res){
    var query = 'SELECT name,description,start_date,id FROM tournament_tournaments WHERE start_date > now() ORDER BY start_date ASC';
    utils.runQuery(connectionpool, query, req, res, doStuff);
});

function doStuff(res) {
    console.log(res);
}

router.get('/base/:id', function(req, res) {
    // var query = 'SELECT name, description, amount, cash_prize, discount, status, start_date, end_date FROM tournament_tournaments WHERE id=' + req.params.id;
    var query = queryString + req.params.id;
    utils.runQuery(connectionpool, query, req, res, doStuff);
});

module.exports = router;
{'fraction_non_alphanumeric': 0.122992700729927, 'fraction_numerical': 0.0, 'mean_word_length': 4.001824817518248, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7226346', 'n_tokens_mistral': 831, 'n_tokens_neox': 822, 'n_words': 185}