public function toSQL(Parameters $params, bool $inner_clause)
    {
        if ($key = $this->getKey())
        {
            try
            {
                $params->get($key);
            }
            catch (\OutOfRangeException $e)
            {
                $key = null;
            }
        }

        if ($key === null)
        {
            $val = $this->getValue();
            if (is_bool($val))
                $val = $val ? 1 : 0;
            $key = $params->assign($val, $this->getParameterType());
        }
        $this->bind($params, $key, null);

        return ':' . $key;
    }