@function buildWhere

build where clause from where argument

@param {string} name
@param {array|boolean|object|string} value
@param {string|undefined} alias

@throws {Error}
341855
function buildWhere (name, value, alias) {
    return name === 'relation'
        ? this.buildWhereRelation(name, value)
        : this.buildWhereModel(name, value, alias)
}
1203950
protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, string $operator, string $value, string $nullManagement = null, $type = null)
    {
        $type = (string) $type;
        try {
            $value = false === strpos($type, '_immutable') ? new \DateTime($value) : new \DateTimeImmutable($value);
        } catch (\Exception $e) {
            // Silently ignore this filter if it can not be transformed to a \DateTime
            $this->logger->notice('Invalid filter ignored', [
                'exception' => new InvalidArgumentException(sprintf('The field "%s" has a wrong date format. Use one accepted by the \DateTime constructor', $field)),
            ]);

            return;
        }

        $valueParameter = $queryNameGenerator->generateParameterName($field);
        $operatorValue = [
            self::PARAMETER_BEFORE => '<=',
            self::PARAMETER_STRICTLY_BEFORE => '<',
            self::PARAMETER_AFTER => '>=',
            self::PARAMETER_STRICTLY_AFTER => '>',
        ];
        $baseWhere = sprintf('%s.%s %s :%s', $alias, $field, $operatorValue[$operator], $valueParameter);

        if (null === $nullManagement || self::EXCLUDE_NULL === $nullManagement) {
            $queryBuilder->andWhere($baseWhere);
        } elseif (
            (self::INCLUDE_NULL_BEFORE === $nullManagement && \in_array($operator, [self::PARAMETER_BEFORE, self::PARAMETER_STRICTLY_BEFORE], true)) ||
            (self::INCLUDE_NULL_AFTER === $nullManagement && \in_array($operator, [self::PARAMETER_AFTER, self::PARAMETER_STRICTLY_AFTER], true)) ||
            (self::INCLUDE_NULL_BEFORE_AND_AFTER === $nullManagement && \in_array($operator, [self::PARAMETER_AFTER, self::PARAMETER_STRICTLY_AFTER, self::PARAMETER_BEFORE, self::PARAMETER_STRICTLY_BEFORE], true))
        ) {
            $queryBuilder->andWhere($queryBuilder->expr()->orX(
                $baseWhere,
                $queryBuilder->expr()->isNull(sprintf('%s.%s', $alias, $field))
            ));
        } else {
            $queryBuilder->andWhere($queryBuilder->expr()->andX(
                $baseWhere,
                $queryBuilder->expr()->isNotNull(sprintf('%s.%s', $alias, $field))
            ));
        }

        $queryBuilder->setParameter($valueParameter, $value, $type);
    }
1081991
function (name, value) {
                targeting[slot] = targeting[slot] || {};
                targeting[slot][name] = value;
            }
1072355
public StringBuilder onWhereClause(StringBuilder builder, Class fieldClazz, String field, Object value,
            String clause, boolean useToken)
    {

        if (clause.trim().equals(IN_CLAUSE))
        {
            useToken = false;
        }

        builder = ensureCase(builder, field, useToken);
        builder.append(SPACE_STRING);
        if (fieldClazz.isAssignableFrom(List.class) || fieldClazz.isAssignableFrom(Map.class)
                || fieldClazz.isAssignableFrom(Set.class))
        {
            builder.append("CONTAINS");
        }
        else
        {
            builder.append(clause);
        }
        builder.append(SPACE_STRING);

        if (clause.trim().equals(IN_CLAUSE))
        {
            builder.append(OPEN_BRACKET);
            String itemValues = String.valueOf(value);
            itemValues = itemValues.startsWith(OPEN_BRACKET) && itemValues.endsWith(CLOSE_BRACKET) ? itemValues
                    .substring(1, itemValues.length() - 1) : itemValues;
            List<String> items = Arrays.asList(((String) itemValues).split("\\s*,\\s*"));
            int counter = 0;
            for (String str : items)
            {
                str = str.trim();
                str = (str.startsWith(Constants.ESCAPE_QUOTE) && str.endsWith(Constants.ESCAPE_QUOTE))
                        || (str.startsWith("'") && str.endsWith("'")) ? str.substring(1, str.length() - 1) : str;
                appendValue(builder, fieldClazz, str, false, false);
                counter++;
                if (counter < items.size())
                {
                    builder.append(COMMA_STR);
                }

            }
            builder.append(CLOSE_BRACKET);
        }
        else
        {
            appendValue(builder, fieldClazz, value, false, useToken);
        }
        return builder;
    }
1212356
function(name, value) {
      var lcname = name.toLowerCase();
      if (typeof value === "string" &&
          lcname in this._designSet.param &&
          'multiValue' in this._designSet.param[lcname]) {
          value = [value];
      }
      this.jCal[PROP_INDEX][name] = value;
    }
1050996
public function set($name, $value, $where = '')
    {
        if (($name && $this->canSetProperty($name)) || strpos($name, 'on ') === 0 || strpos($name, 'as ') === 0) {
            parent::__set($name, $value);
        } else {
            $this->setItem($name, $value, $where);
        }
    }
545315
function createClause (options) {
  options = options || {}
  if (!options.where) return ''

  // AST parsing requires a complete SQL.
  const whereTree = parser.parse('SELECT * WHERE ' + options.where).where
  return traverse(whereTree, options)
}
817346
function whereExists(callback) {
    this._statements.push({
      grouping: 'where',
      type: 'whereExists',
      value: callback,
      not: this._not(),
      bool: this._bool() });
    return this;
  }
1051036
public static void setLocalVar(ExecutionContext context, String name, Object value) {
        LexicalEnvironment localEnv = context.getLexicalEnvironment();
        localEnv.getRecord().createMutableBinding(context, name, false);
        localEnv.getRecord().setMutableBinding(context, name, value, false);
    }
1303170
function QueryWhere(data)
{
	//Initialize the string
	var sql = '';

	//Check the type
	if(typeof data === 'string')
	{
		//Return the where
		return data;
	}

	//Get all data
	for(var key in data)
	{
		//Save data value
		var value = data[key];

		//Check the data type
		if(typeof value === 'string' || value instanceof String)
		{
			//Add the quotes
			value = '"' + value + '"';
		}

		//Check if is necessary add the AND
		if(sql !== '')
		{
			//Add the AND
			sql = sql + ' AND ';
		}

		//Add the key=value
		sql = sql + key + '=' + value;
	}

	//Return the string
	return sql;
}
1292601
def build_where_clause(mappings, operator='AND'):
        
        where_clause_mappings = {}
        where_clause_mappings.update(mappings)

        where_clause = 'WHERE ' + ' {} '.format(operator).join(
            '{k} = {v}'.format(k=k, v='"{}"'.format(v) if isinstance(v, basestring) else v)
            for k, v in where_clause_mappings.iteritems()
        )
        return where_clause
882411
public function handlerAlias($name, $value = null)
    {
        $alias = is_array($name) ? $name : [$name => $value];
        $this->handlerAlias = $alias + $this->handlerAlias;
    }
348420
void addWhereClause(StringBuilder builder) {
        if (!getKunderaQuery().getFilterClauseQueue().isEmpty()) {
            builder.append(CQLTranslator.ADD_WHERE_CLAUSE);
        }
    }
987049
public function where($name, $operator = "=", $value = NULL)
    {

        if (is_callback_function($name)) {
            $name($this);
            return $this;
        }

        if (!$this->isOperator($operator)) {
            $value = $operator;
            $operator = "=";
        }

        if ($operator == "=") {

            if ($name == "_id") {
                return $this->_id($value);
            }

            $this->filter[] = ["term" => [$name => $value]];
        }

        if ($operator == ">") {
            $this->filter[] = ["range" => [$name => ["gt" => $value]]];
        }

        if ($operator == ">=") {
            $this->filter[] = ["range" => [$name => ["gte" => $value]]];
        }

        if ($operator == "<") {
            $this->filter[] = ["range" => [$name => ["lt" => $value]]];
        }

        if ($operator == "<=") {
            $this->filter[] = ["range" => [$name => ["lte" => $value]]];
        }

        if ($operator == "like") {
            $this->must[] = ["match" => [$name => $value]];
        }

        if ($operator == "exists") {
            $this->whereExists($name, $value);
        }

        return $this;
    }
711732
function filterWhere(q, filter) {
    if (typeof filter !== 'object' || filter.where === undefined)
      return;

    if (Object.keys(filter.where).length !== 0) {
      check(q, filter.where);
      q.where(filter.where);
    }
  }
1147594
function orwhere($where)
    {
        $args = func_get_args();
        if (count($args) == 1)
        {
            $where = $args[0];
        }
        else
        {
            list($field, $expr, $value) = $args;
            $where = '`'.str_replace('`', '', $field).'`' . $this->db->quote($expr) . " '".$this->db->quote($value)."'";
        }

        if ($this->where == "")
        {
            $this->where = "where " . $where;
        }
        else
        {
            $this->where = $this->where . " or " . $where;
        }
    }
717642
function(name, value) {
		var hit, gux = this.spirit.window.gui;
		gux.attributes.every(function(fix) {
			if ((hit = name.startsWith(fix + '.'))) {
				this._evaluate(name, value, fix);
			}
			return !hit;
		}, this);
	}