smi2 / phpClickHouse

php ClickHouse wrapper
MIT License
750 stars 139 forks source link

Converting boolean when inserting into int #202

Closed MakarMS closed 9 months ago

MakarMS commented 10 months ago

When inserting, a problem was found that if you pass a boolean as a value, this value is converted to int and clickhouse cannot handle this case because boolean is expected as input data, not int.

This is due to implode in StrictQuoteLine.php in the quoteRow method, which convert boolean to int.

     * @param $row
     * @param bool $skipEncode
     * @return string
     */
    public function quoteRow($row,bool $skipEncode=false )
    {
        return implode($this->settings['Delimiter'], $this->quoteValue($row,$skipEncode));
    }