<commit_before>import type * as MYSQL from "mysql";
import { ConnectionOptions } from "typeorm";
import * as TypeormDriver from "typeorm/driver/mysql/MysqlDriver";
import { DataTypeDefaults } from "typeorm/driver/types/DataTypeDefaults";
import * as TomgUtils from "../Utils";
import AbstractDriver from "./AbstractDriver";
import IConnectionOptions from "../IConnectionOptions";
import { Entity } from "../models/Entity";
import { Column } from "../models/Column";
import { Index } from "../models/Index";
import { RelationInternal } from "../models/RelationInternal";
import IGenerationOptions from "../IGenerationOptions";

export default class MysqlDriver extends AbstractDriver {
    public defaultValues: DataTypeDefaults = new TypeormDriver.MysqlDriver({
        options: { replication: undefined } as ConnectionOptions,
    } as any).dataTypeDefaults;

    public readonly EngineName: string = "MySQL";

    public readonly standardPort = 3306;

    public readonly standardUser = "root";

    public readonly standardSchema = "";

    private MYSQL: typeof MYSQL;

    private Connection: MYSQL.Connection;

    public constructor() {
        super();
        try {
            // eslint-disable-next-line import/no-extraneous-dependencies, global-require, import/no-unresolved
            this.MYSQL = require("mysql");
        } catch (error) {
            TomgUtils.LogError("", false, error);
            throw error;
        }<commit_msg>Update mysql => mysql2<commit_after>import type * as MYSQL from "mysql2";
import { ConnectionOptions } from "typeorm";
import * as TypeormDriver from "typeorm/driver/mysql/MysqlDriver";
import { DataTypeDefaults } from "typeorm/driver/types/DataTypeDefaults";
import * as TomgUtils from "../Utils";
import AbstractDriver from "./AbstractDriver";
import IConnectionOptions from "../IConnectionOptions";
import { Entity } from "../models/Entity";
import { Column } from "../models/Column";
import { Index } from "../models/Index";
import { RelationInternal } from "../models/RelationInternal";
import IGenerationOptions from "../IGenerationOptions";

export default class MysqlDriver extends AbstractDriver {
    public defaultValues: DataTypeDefaults = new TypeormDriver.MysqlDriver({
        options: { replication: undefined } as ConnectionOptions,
    } as any).dataTypeDefaults;

    public readonly EngineName: string = "MySQL";

    public readonly standardPort = 3306;

    public readonly standardUser = "root";

    public readonly standardSchema = "";

    private MYSQL: typeof MYSQL;

    private Connection: MYSQL.Connection;

    public constructor() {
        super();
        try {
            // eslint-disable-next-line import/no-extraneous-dependencies, global-require, import/no-unresolved
            this.MYSQL = require("mysql2");
        } catch (error) {
            TomgUtils.LogError("", false, error);
            throw error;
        }
{'fraction_non_alphanumeric': 0.11252144082332761, 'fraction_numerical': 0.0037735849056603774, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2236874', 'n_tokens_mistral': 763, 'n_tokens_neox': 739, 'n_words': 222}