<commit_before>
'use strict';

/**
 * @namespace Jii
 * @ignore
 */
var Jii = require('jii');

var mysql = require('mysql');

require('../BaseConnection');

/**
 *
 * @class Jii.sql.mysql.Connection
 * @extends Jii.sql.BaseConnection
 */
Jii.defineClass('Jii.sql.mysql.Connection', {

	__extends: Jii.sql.BaseConnection,

	/**
	 * @type {string}
	 */
	host: '127.0.0.1',

	/**
	 * @type {string}
	 */
	port: 3306,

	/**
	 * @type {string}
	 */
	database: '',

	/**
	 * @type {string|object}
	 */
	schemaClass: 'Jii.sql.mysql.Schema',

	/**
	 * @type {string}
	 */
	driverName: 'mysql',

	_connection: null,

	/**
	 * Initializes the DB connection.
	 * This method is invoked right after the DB connection is established.
	 * @protected
	 */
	_initConnection: function () {
		this._connection = mysql.createConnection({
			host: this.host,
			port: this.port,
			user: this.username,
			password: <PASSWORD>,
			database: this.database,
			timezone: 'local',
			typeCast: this._typeCast
		});
		this._connection.on('error', this._onError);
		this._connection.connect();

		if (this.charset !== null) {
			this.exec('SET NAMES ' + this.quoteValue(this.charset));
		}

		this.__super();
	},

	/**
	 * @protected
	 */
	_closeConnection: function () {
		if (this._connection) {
			this._connection.end();
		}
	},

	/**
	 * Disable auto typing
	 * @returns {string}
	 * @private
	 */
	_typeCast: function (field, next) {
		return field.string();
	},

	/**
	 *
	 * @param {string} message
	 * @private
	 */
	_onError: function(message) {

	},

	/**
	 *
	 * @param {string} sql
	 * @param {string} [method]
	 * @returns {Jii.when}
	 */
	exec: function(sql, method) {
		method = method || null;

		console.log(sql);

		return new Jii.when.promise(function(resolve, reject) {<commit_msg>Update boilerplate, fix http server body request, fix validators on empty scenarios<commit_after>
'use strict';

/**
 * @namespace Jii
 * @ignore
 */
var Jii = require('jii');

var mysql = require('mysql');

require('../BaseConnection');

/**
 *
 * @class Jii.sql.mysql.Connection
 * @extends Jii.sql.BaseConnection
 */
Jii.defineClass('Jii.sql.mysql.Connection', {

	__extends: Jii.sql.BaseConnection,

	/**
	 * @type {string}
	 */
	host: '127.0.0.1',

	/**
	 * @type {string}
	 */
	port: 3306,

	/**
	 * @type {string}
	 */
	database: '',

	/**
	 * @type {string|object}
	 */
	schemaClass: 'Jii.sql.mysql.Schema',

	/**
	 * @type {string}
	 */
	driverName: 'mysql',

	_connection: null,

	/**
	 * Initializes the DB connection.
	 * This method is invoked right after the DB connection is established.
	 * @protected
	 */
	_initConnection: function () {
		this._connection = mysql.createConnection({
			host: this.host,
			port: this.port,
			user: this.username,
			password: <PASSWORD>,
			database: this.database,
			timezone: 'local',
			typeCast: this._typeCast
		});
		this._connection.on('error', this._onError);
		this._connection.connect();

		if (this.charset !== null) {
			this.exec('SET NAMES ' + this.quoteValue(this.charset));
		}

		this.__super();
	},

	/**
	 * @protected
	 */
	_closeConnection: function () {
		if (this._connection) {
			this._connection.end();
		}
	},

	/**
	 * Disable auto typing
	 * @returns {string}
	 * @private
	 */
	_typeCast: function (field, next) {
		return field.string();
	},

	/**
	 *
	 * @param {string} message
	 * @private
	 */
	_onError: function(message) {

	},

	/**
	 *
	 * @param {string} sql
	 * @param {string} [method]
	 * @returns {Jii.when}
	 */
	exec: function(sql, method) {
		method = method || null;

		//console.log(sql);

		return new Jii.when.promise(function(resolve, reject) {
{'fraction_non_alphanumeric': 0.17981246552675123, 'fraction_numerical': 0.005515719801434087, 'mean_word_length': 3.0752808988764047, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4703598', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1238, 'n_words': 267}