<commit_before>import * as SequelizeStatic from 'sequelize'
import { Sequelize } from 'sequelize'
import * as winston from 'winston'

const config = require('/data/config.json')

const database: Sequelize = new SequelizeStatic(
    config.database.name,
    config.database.username,
    config.database.password,
    {
        dialect: 'postgres',
        host: config.database.host || 'localhost',
        logging: false,
        port: config.database.port || 5432
    }
)

export default class PostgreSQL {
    public static get db(): Sequelize {
        return database
    }

    public static start(): void {
        database.authenticate()
            .then(() => winston.info('Successfully connected to database. Syncing...'))
            .then(() => database.sync())
            .then(() => winston.info('Database sync complete.'))
            .catch((err: Error) => winston.error(`Error connecting to database: ${err}`))
    }
}
<commit_msg>Define config type<commit_after>import * as SequelizeStatic from 'sequelize'
import { Sequelize } from 'sequelize'
import * as winston from 'winston'

const config: {
    token: string,
    owner: string | string[],
    prefix: string,
    logLevel: 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly',
    database: {
        host: string,
        port: number,
        username: string,
        password: string,
        name: string
    }
} = require('/data/config.json')

const database: Sequelize = new SequelizeStatic(
    config.database.name,
    config.database.username,
    config.database.password,
    {
        dialect: 'postgres',
        host: config.database.host || 'localhost',
        logging: false,
        port: config.database.port || 5432
    }
)

export default class PostgreSQL {
    public static get db(): Sequelize {
        return database
    }

    public static start(): void {
        database.authenticate()
            .then(() => winston.info('Successfully connected to database. Syncing...'))
            .then(() => database.sync())
            .then(() => winston.info('Database sync complete.'))
            .catch((err: Error) => winston.error(`Error connecting to database: ${err}`))
    }
}

{'fraction_non_alphanumeric': 0.1301279223643582, 'fraction_numerical': 0.0035288928098809, 'mean_word_length': 2.3157894736842106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2821204', 'n_tokens_mistral': 652, 'n_tokens_neox': 633, 'n_words': 167}