@see \PDO::quote()

@param string $string
@param int $parameter_type
@return string
1732
public function quote($string, $parameter_type = \PDO::PARAM_STR): string {
        return $this->connection->quote($string, $parameter_type);
    }
151838
public function bindValue($parameter, $value, $data_type = \PDO::PARAM_STR) {
        $this->_debugBindValues[$parameter] = $value;
        parent::bindValue($parameter, $value, $data_type);
    }
526201
public final String quoted_string() throws RecognitionException {
        String value = null;


        Token STRING_WITH_QUOTE_DOUBLE6=null;
        Token STRING_WITH_QUOTE7=null;

        try {
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:96:3: ( STRING_WITH_QUOTE_DOUBLE | STRING_WITH_QUOTE )
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==STRING_WITH_QUOTE_DOUBLE) ) {
                alt7=1;
            }
            else if ( (LA7_0==STRING_WITH_QUOTE) ) {
                alt7=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 7, 0, input);

                throw nvae;

            }
            switch (alt7) {
                case 1 :
                    // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:96:5: STRING_WITH_QUOTE_DOUBLE
                    {
                    STRING_WITH_QUOTE_DOUBLE6=(Token)match(input,STRING_WITH_QUOTE_DOUBLE,FOLLOW_STRING_WITH_QUOTE_DOUBLE_in_quoted_string288); 


                          String str = (STRING_WITH_QUOTE_DOUBLE6!=null?STRING_WITH_QUOTE_DOUBLE6.getText():null);
                          str = str.substring(1, str.length()-1);
                          value = str.trim();
                        

                    }
                    break;
                case 2 :
                    // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:101:5: STRING_WITH_QUOTE
                    {
                    STRING_WITH_QUOTE7=(Token)match(input,STRING_WITH_QUOTE,FOLLOW_STRING_WITH_QUOTE_in_quoted_string296); 


                          String str = (STRING_WITH_QUOTE7!=null?STRING_WITH_QUOTE7.getText():null);
                          str = str.substring(1, str.length()-1);
                          value = str.trim();
                        

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return value;
    }
1059323
public function quote($parameter, $parameter_type = PDO::PARAM_STR){
        return $this->connection->quote($parameter, $parameter_type);
    }
1067387
public static String quote(final String string) {
        int last = 0;
        final StringBuilder sb = new StringBuilder();
        for (int i = 0; i < string.length(); i++) {
            if (needsQuoting(string.charAt(i))) {
                sb.append(string, last, i);
                last = i = quote(sb, string, i);
            }
        }
        sb.append(string, last, string.length());
        return sb.toString();
    }
105062
public static function quote_table($string, $db = null)
	{
		if (is_array($string))
		{
			foreach ($string as $k => $s)
			{
				$string[$k] = static::quote_table($s, $db);
			}
			return $string;
		}
		return \Database_Connection::instance($db)->quote_table($string);
	}
852935
public function quote($parameter, $parameter_type = PDO::PARAM_STR){
        return $this->getDriver()->quote($parameter, $parameter_type);
    }
239096
public function quote($value, $type = DB::PARAM_AUTO) {
        if (is_array($value))
            return sprintf('(%s)', implode(', ', array_map(function($v) use($this, $type) {
                                return $this->quote($v, $type);
                            }, $value)));
        $type = ($type == DB::PARAM_AUTO) ? $this->quotedType($value) : $type;
        switch ($type) {
            case DB::PARAM_STR:
                $value = $this->escapeString($value);
                break;
            case DB::PARAM_DATE:
            case DB::PARAM_TIME:
            case DB::PARAM_DATETIME:
                switch ($type) {
                    case DB::PARAM_DATE:
                        $format = 'Y-m-d';
                        break;
                    case DB::PARAM_TIME:
                        $format = 'H:i:s';
                        break;
                    default:
                        $format = 'Y-m-d H:i:s';
                }
                if (interface_exists('\\DateTimeInterface') and $value instanceof \DateTimeInterface or $value instanceof \DateTime)
                    $value = $value->format($format);
                else {
                    $dt = date_create($value);
                    if ($dt === false)
                        $dt = new \DateTime;
                    if (is_int($value))
                        $dt->setTimestamp($value);
                    $value = $dt->format($format);
                }
                break;
            case DB::PARAM_INT:
                $value = intval($value);
                break;
            case DB::PARAM_BOOL:
                $value = $value ? 1 : 0;
                break;
            case DB::PARAM_FLOAT:
                $value = floatval($value);
                break;
            case DB::PARAM_NULL:
                $value = 'NULL';
                break;
            default:
                throw new \UnexpectedValueException('Invalid parameter value');
        }
        return ($type & DB::PARAM_STR) ? "'$value'" : $value;
    }
1301868
public function quote ($string)
		{
			if (is_null($string)) {
				return 'NULL';

			} else if (is_int($string) || is_float($string)) {
				return $string;

			} else if ($string instanceof Raw || $string instanceof DatabaseQuery) {
				return (string) $string;

			} else {
				return $this->database->quote($string);
			}
		}
1269407
public function quote($string)
    {
        if(is_null($string)) {
            return 'NULL';
        }
        else if(is_bool($string)) {
            return $string === true ? 1 : "''";
        }
        else {
            return sprintf("'%s'", $string);
        }
    }
1269856
public static function wrap(string $string, $quote = ['"', '"']): string
    {
        $quote = (array) $quote;

        if (empty($quote[1])) {
            $quote[1] = $quote[0];
        }

        return $quote[0] . $string . $quote[1];
    }
1068831
private static int quote(final StringBuilder target, final String string, final int start) {
        int i = quoteSingle(target, string, start);
        if (i < 0) i = quoteBlock(target, string, start, -i);
        return i;
    }
1095933
static function embedParams($string, $params, DABLPDO $conn = null) {
		if (null != $conn) {
			$params = $conn->prepareInput($params);
		} else {
			foreach($params as &$value) {
				if (is_int($value)) {
					continue;
				} elseif (is_bool($value)) {
					$value = $value ? 1 : 0;
				} elseif (is_null($value)) {
					$value = 'NULL';
				} else {
					$value = "'{$value}'";
				}
			}
		}

		// escape % by making it %%
		$string = str_replace('%', '%%', $string);

		// replace ? with %s
		$string = str_replace(self::PARAM, '%s', $string);

		// add $query to the beginning of the array
		array_unshift($params, $string);

		if (!($string = @call_user_func_array('sprintf', $params))) {
			throw new RuntimeException('Could not insert parameters into query string. The number of ?s might not match the number of parameters.');
		}
		return $string;
	}
746715
public function bindParam(
        $parameter,
        &$variable,
        $data_type = PDO::PARAM_STR,
        $length = -1,
        $driver_options = null
    )
    {
        if ($driver_options !== null) {
            throw new PDOException('$driver_options is not implemented for PoolPDOStatement::bindParam()');
        }
        if (is_array($variable)) {
            if ($length == -1) {
                $length = count($variable);
            }
        } else {
            if ($length == -1) {
                $length = strlen((string)$variable);
            }
        }
        $this->_boundColumns[$parameter] = $variable;
        return true;
    }
1010004
def quote_sql(value, param=None):
    
    try:
        if isinstance(value, SQL):
            if not param:
                return value
            param = {k: quote_sql(v) for k, v in param.items()}
            return SQL(expand_template(value, param))
        elif is_text(value):
            return SQL(value)
        elif is_data(value):
            return quote_value(json_encode(value))
        elif hasattr(value, '__iter__'):
            return quote_list(value)
        else:
            return text_type(value)
    except Exception as e:
        Log.error("problem quoting SQL", e)
388738
public function bindParam($parameter, &$variable, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null) {
		$this->boundValues[$parameter] = $variable;
		return parent::bindParam($parameter, $variable, $data_type, $length, $driver_options);
	}
856383
public function quote($string, $type='string')
    {
        if ($type == 'string') {
            return "'" . str_replace("'", "''", $string) . "'";
        }

        if ($type != 'name') {
            throw new InvalidArgumentException("type has to be either string|name, not $type");
        }

        return '"' . str_replace('"', '""', $string) . '"';
    }