public function createConnection($parameters)
    {
        $connection = new \PDO(
            'mysql:host=' . $parameters['host'] . ';dbname=' . $parameters['database'],
            $parameters['username'],
            $parameters['password']
        );

        if (isset($parameters['charset'])) {
            $connection->exec('SET CHARACTER SET ' . $parameters['charset']);
        }

        return $connection;
    }