protected function prepareBind(string $sql, array $parameters = []): ?PDOStatement
    {
        if ($this->pdo === null) {
            $this->connect();
        }

        $statement = null;

        try {
            $statement = $this->pdo->prepare($sql);
            if ($statement === false) {
                throw new Exception('Error Prepare Statement');
            }
        } catch (Exception $e) {
            $this->addErrorPrepare($sql, $parameters);
            if ($this->configurator->hasThrowException()) {
                throw new DatabaseException('Error Prepare Statement');
            }
        }

        if ($statement === false) {
            return null;
        }

        foreach ($parameters as $key => $value) {
            $param = $this->getPdoParamType($value);
            if (\is_float($value)) {
                $value = (string) $value;
            }

            if ($param === false) {
                throw new DatabaseException('Error Bind Value');
            }

            try {
                $statement->bindValue(":$key", $value, $param);
            } catch (PDOException $e) {
                throw new DatabaseException($e->getMessage());
            }
        }

        return $statement;
    }
protected function prepareBind(string $sql, array $parameters = []): ?PDOStatement
    {
        if ($this->pdo === null) {
            $this->connect();
        }

        $statement = null;

        try {
            $statement = $this->pdo->prepare($sql);
            if ($statement === false) {
                throw new Exception('Error Prepare Statement');
            }
        } catch (Exception $e) {
            $this->addErrorPrepare($sql, $parameters);
            if ($this->configurator->hasThrowException()) {
                throw new DatabaseException('Error Prepare Statement');
            }
        }

        if ($statement === false) {
            return null;
        }

        foreach ($parameters as $key => $value) {
            $param = $this->getPdoParamType($value);
            if (\is_float($value)) {
                $value = (string) $value;
            }

            if ($param === false) {
                throw new DatabaseException('Error Bind Value');
            }

            try {
                $statement->bindValue(":$key", $value, $param);
            } catch (PDOException $e) {
                throw new DatabaseException($e->getMessage());
            }
        }

        return $statement;
    }
@param string $sql
@param array  $parameters

@throws DatabaseException

@return PDOStatement