<commit_before><?php
/**
 * PostgreSQL driver
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright 2020 <NAME>
 * @license   https://en.wikipedia.org/wiki/MIT_License MIT License
 * @link      https://github.com/Falseclock/dbd-php
 * @noinspection PhpComposerExtensionStubsInspection
 */

declare(strict_types=1);

namespace DBD;

use DBD\Common\Bind;
use DBD\Common\DBDException;
use DBD\Entity\Primitives\NumericPrimitives;
use DBD\Entity\Primitives\StringPrimitives;
use DBD\Helpers\ConversionMap;
use DBD\Helpers\InsertArguments;
use DBD\Helpers\UpdateArguments;
use DBD\Tests\Pg\PgNamedTest;
use DBD\Tests\Pg\PgQueryTest;
use DBD\Tests\Pg\PgTransactionTest;
use Exception;
use Throwable;

class Pg extends DBD
{
    public const CAST_FORMAT_INSERT = "?::%s";
    public const CAST_FORMAT_UPDATE = "%s = ?::%s";

    /**
     * Setup connection to the resource
     *
     * @return Pg
     * @throws DBDException
     */
    public function connect(): DBD
    {
        $dsn = "host={$this->Config->getHost()} ";
        $dsn .= "dbname={$this->Config->getDatabase()} ";
        $dsn .= $this->Config->getUsername() ? "user={$this->Config->getUsername()} " : "";
        $dsn .= $this->Config->getPassword() ? "password={$this->Config->getPassword()} " : "";
        $dsn .= $this->Config->getPort() ? "port={$this->Config->getPort()} " : "";
        $dsn .= "application_name={$this->Options->getApplicationName()} options='-c extra_float_digits=1'";

        $this->Config->setDsn($dsn);
<commit_msg>testConvertTypes<commit_after><?php
/**
 * PostgreSQL driver
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright 2020 <NAME>
 * @license   https://en.wikipedia.org/wiki/MIT_License MIT License
 * @link      https://github.com/Falseclock/dbd-php
 * @noinspection PhpComposerExtensionStubsInspection
 */

declare(strict_types=1);

namespace DBD;

use DBD\Common\Bind;
use DBD\Common\DBDException;
use DBD\Entity\Primitives\NumericPrimitives;
use DBD\Entity\Primitives\StringPrimitives;
use DBD\Helpers\ConversionMap;
use DBD\Helpers\InsertArguments;
use DBD\Helpers\UpdateArguments;
use DBD\Tests\Pg\PgNamedTest;
use DBD\Tests\Pg\PgQueryTest;
use DBD\Tests\Pg\PgTransactionTest;
use Exception;
use Throwable;

class Pg extends DBD
{
    public const CAST_FORMAT_INSERT = "?::%s";
    public const CAST_FORMAT_UPDATE = "%s = ?::%s";

    /**
     * Setup connection to the resource
     *
     * @return Pg
     * @throws DBDException
     */
    public function connect(): DBD
    {
        $dsn = "host={$this->Config->getHost()} ";
        $dsn .= "dbname={$this->Config->getDatabase()} ";
        $dsn .= $this->Config->getUsername() ? "user={$this->Config->getUsername()} " : "";
        $dsn .= $this->Config->getPassword() ? "password={$this->Config->getPassword()} " : "";
        $dsn .= $this->Config->getPort() ? "port={$this->Config->getPort()} " : "";
        $dsn .= "application_name={$this->Options->getApplicationName()}";

        $this->Config->setDsn($dsn);

{'fraction_non_alphanumeric': 0.17457114026236126, 'fraction_numerical': 0.003699966363942146, 'mean_word_length': 3.6614420062695925, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 51, 'https://': 4, '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': '5948540', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1025, 'n_words': 174}