Check if column can be filtered for query.

@param  string  $on
@param  array   $columns

@return bool
517835
protected function isColumnExcludedFromFilterable(string $on, array $columns = []): bool
    {
        $only = $columns['only'] ?? '';
        $except = $columns['except'] ?? '';

        return (! empty($only) && ! \in_array($on, (array) $only)) ||
            (! empty($except) && \in_array($on, (array) $except));
    }
233520
public function notIn(array $columns)
    {
        $results = [];
        foreach ($this->columns as $name => $column) {
            if (!in_array($name, $columns, true)) {
                $results[] = $name;
            }
        }

        return new Result($results, $this->columns);
    }
635440
public function findWhere(array $where, $columns = ['*'])
    {
        $this->newQuery();

        foreach ($where as $field => $value) {
            if (is_array($value)) {
                list($field, $condition, $val) = $value;
                $this->query->where($field, $condition, $val);
            }
            else {
                $this->query->where($field, '=', $value);
            }
        }

        return $this->query->get($columns);
    }
341505
public function columnsAreIndexed(array $columnNames)
    {
        foreach ($this->getIndexes() as $index) {
            /** @var $index Index */
            if ($index->spansColumns($columnNames)) {
                return true;
            }
        }

        return false;
    }
412404
public function selectOnly(string $column, string ...$columns)
    {
        return $this->selectFrom($this, $column, ...$columns);
    }
332425
public function join($table, $on, array $columns = array())
    {
        if (!array_key_exists('joins', $this->query)) {
            $this->query['joins'] = array();
        }

        $this->query['select'] = array_merge($this->query['select'], $columns);
        $this->query['joins'][] = array($table, $on);

        return $this;
    }
309307
public function select($columns = [])
    {
        $expr = new ColumnExpression($this->sql);

        if ($columns instanceof Closure) {
            $columns($expr);
        } else {
            if (!is_array($columns)) {
                $columns = [$columns];
            }
            $expr->columns($columns);
        }
    }
1128765
protected function filterStoreCondition($collection, $column)
    {
        if (!($value = $column->getFilter()->getValue())) {
            return;
        }

        $collection->addStoreFilter($value);
    }
1838
protected function shouldSelect(array $columns = ['*'])
    {
        if ($columns === ['*']) {
            $columns = [$this->related->getTable() . '.*'];
        }

        return array_merge($columns, $this->aliasedPivotColumns());
    }
821232
public function checkExistsColumns($columns = [])
    {
        $this->connection();

        return $this->getSchema()->hasColumns($this->table, $columns);
    }
555694
protected function select(array $columns = [])
    {
        $columns = !is_array($columns) ? func_get_args() : $columns;

        if (empty($columns)) {
            $columns = ['*'];
        }

        return static::db()->select($columns)->from($this->table());
    }
401639
public function orWhereMultiple(array $columns)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->orWhereMultiple($columns);

        return $instance;
    }
1359188
public function canFilterAnyColumns($gridField)
    {
        $list = $gridField->getList();

        if (!$this->checkDataType($list)) {
            return false;
        }

        $columns = $gridField->getColumns();
        foreach ($columns as $columnField) {
            $metadata = $gridField->getColumnMetadata($columnField);
            $title = $metadata['title'];

            if ($title && $list->canFilterBy($columnField)) {
                return true;
            }
        }

        return false;
    }
69170
public function where($column, $operator = '=', $value = null, $boolean = 'and', array $columns = ['*'])
    {
        return $this->repository->makeQuery()->where($column, $operator, $value, $boolean, $columns)->get($columns);
    }
1346448
public function select($columns = '*'): SelectQuery
    {
        return $this->database->select(func_num_args() ? func_get_args() : '*')->from($this->name);
    }
97896
public function findWhere(array $where, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();

        $this->applyConditions($where);

        $model = $this->model->get($columns);
        $this->resetModel();

        return $this->parserResult($model);
    }
394481
public function selectQuery(string $prefix, array $from = [], array $columns = []): SelectQuery
    {
        return new SelectQuery($this, $this->getCompiler($prefix), $from, $columns);
    }