<commit_before>var Queue = require('./queue');
var JqueueException = require('./exception');
var callBack = require('./callback');

function Jqueue(ds) {

    var dataSource = ds;
    var dataSource;
    var queues = {};

    function execQuery(query, params, cb) {
        dataSource.getConnection(function (error, connection) {
            if (error) {
                cb(error);
            } else {
                connection.query(query, params, cb);
                connection.release();
            }
        });
    }

    function verifyIfQueueExists(queueName, cb) {
        execQuery('SELECT 1 FROM ?? LIMIT 1', [queueName], cb);
    }

    function createNewQueue(queueName, isMemory, cb) {
        var storageEngine, dataType;
        if (isMemory) {
            dataType = 'VARCHAR(21800)';
            storageEngine = 'MEMORY';
        } else {
            dataType = 'TEXT';
            storageEngine = 'MyISAM';
        }
        execQuery('CREATE TABLE IF NOT EXISTS ?? (\
        id BIGINT NOT NULL AUTO_INCREMENT,\
        status ENUM(\'ready\', \'reserved\', \'buried\') NOT NULL,\
        data ' + dataType + ' NOT NULL,\
        priority TINYINT NOT NULL,\
        date_time TIMESTAMP NOT NULL,\
        time_to_run TIMESTAMP NULL DEFAULT NULL,\
        version INT NULL DEFAULT NULL,\
        PRIMARY KEY (id)) ENGINE = ??', [queueName, storageEngine], cb);
    }

    function use(queueName, parameter1, parameter2, parameter3) {
        var noCreate, isMemory, cb;
        switch (arguments.length) {
            case 2:
                noCreate = false;
                isMemory = false;<commit_msg>feat(jqueue): when create table, now is added the fields created at and modified at<commit_after>var Queue = require('./queue');
var JqueueException = require('./exception');
var callBack = require('./callback');

function Jqueue(ds) {

    var dataSource = ds;
    var dataSource;
    var queues = {};

    function execQuery(query, params, cb) {
        dataSource.getConnection(function (error, connection) {
            if (error) {
                cb(error);
            } else {
                connection.query(query, params, cb);
                connection.release();
            }
        });
    }

    function verifyIfQueueExists(queueName, cb) {
        execQuery('SELECT 1 FROM ?? LIMIT 1', [queueName], cb);
    }

    function createNewQueue(queueName, isMemory, cb) {
        var storageEngine, dataType;
        if (isMemory) {
            dataType = 'VARCHAR(21800)';
            storageEngine = 'MEMORY';
        } else {
            dataType = 'TEXT';
            storageEngine = 'MyISAM';
        }
        execQuery('CREATE TABLE IF NOT EXISTS ?? (\
        id BIGINT NOT NULL AUTO_INCREMENT,\
        status ENUM(\'ready\', \'reserved\', \'buried\') NOT NULL,\
        data ' + dataType + ' NOT NULL,\
        priority TINYINT NOT NULL,\
        date_time TIMESTAMP NOT NULL,\
        time_to_run TIMESTAMP NULL DEFAULT NULL,\
        version INT NULL DEFAULT NULL,\
        `created_at` TIMESTAMP DEFAULT now(), \
        `modified_at` TIMESTAMP DEFAULT now() ON UPDATE now(), \
        PRIMARY KEY (id)) ENGINE = ??', [queueName, storageEngine], cb);
    }

    function use(queueName, parameter1, parameter2, parameter3) {
        var noCreate, isMemory, cb;
        switch (arguments.length) {
            case 2:
                noCreate = false;
                isMemory = false;
{'fraction_non_alphanumeric': 0.11644832605531295, 'fraction_numerical': 0.006404657933042212, 'mean_word_length': 1.990426457789382, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6385137', 'n_tokens_mistral': 979, 'n_tokens_neox': 931, 'n_words': 269}