Get a new query builder instance.

@param  string  $table
@return \Illuminate\Database\Query\Builder
779241
public static function query($table)
    {
        $query = new Builder(
            $connection = static::user()->getConnection(),
            $connection->getQueryGrammar(),
            $connection->getPostProcessor()
        );

        return $query->from(static::table($table));
    }
1234092
public function getDropTableSQL($table)
    {
        $tableArg = $table;

        if ($table instanceof Table) {
            $table = $table->getQuotedName($this);
        }

        if (! is_string($table)) {
            throw new InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
        }

        if ($this->_eventManager !== null && $this->_eventManager->hasListeners(Events::onSchemaDropTable)) {
            $eventArgs = new SchemaDropTableEventArgs($tableArg, $this);
            $this->_eventManager->dispatchEvent(Events::onSchemaDropTable, $eventArgs);

            if ($eventArgs->isDefaultPrevented()) {
                $sql = $eventArgs->getSql();

                if ($sql === null) {
                    throw new UnexpectedValueException('Default implementation of DROP TABLE was overridden with NULL');
                }

                return $sql;
            }
        }

        return 'DROP TABLE ' . $table;
    }
661186
static function query($table = null)
    {
        $model = new static();
        return $model->newTable($table = null)->asModel(get_class($model));
    }
230561
public static function update($table = null)
    {
        $query = new Update();

        if ($table) {
            $query->table($table);
        }

        return $query;
    }
1285772
public function update(...$table) {
        $sql = new UpdateSQL($table);
        $sql->setDialect($this->dialect);

        return $sql;
    }
844778
public function buildDeleteSQL($table = null)
	{
		$sql = 'delete from ' . $this->parseTable($table) . ' ';
		$where = $this->parseCondition(isset($this->operationOption['where']) ? $this->operationOption['where'] : '');
		if ('' !== $where)
		{
			$where = 'where ' . $where . ' ';
		}
		return $sql
				. $where
				. $this->parseOrder()
				. $this->parseLimit()
				. $this->parseLock()
				;
	}
710517
final public function describe($table)
	{
		$q = $this->query("DESCRIBE `{$table}`");
		$q->execute();
		return $q->fetchAll(self::FETCH_COLUMN);
	}
577126
protected static function getCreateTableSql($table)
    {
        $db = Yii::$app->db;
        $row = $db->createCommand('SHOW CREATE TABLE ' . $db->schema->quoteTableName($table->fullName))->queryOne();
        if (isset($row['Create Table'])) {
            $sql = $row['Create Table'];
        } else {
            $row = array_values($row);
            $sql = $row[1];
        }

        return $sql;
    }
1291203
final public function createTableIfNotExists(Table $table): Database
    {
        if (!$this->hasTable($table::getName())) {
            $this->createTable($table);
        }

        return $this;
    }
748090
public function filter(Table $table)
    {
        $this->sqlAnds = [];
        $this->sqlParams = $this->initialParams;

        $columns = $table->getColumns();
        foreach ($table->getFilters() as $column => $filterData) {
            foreach ($filterData as $name => $value)
                $this->buildFilter($columns[$column]['sql_id'], $columns[$column]['type'], $name, $value);
        }

        return $this;
    }
1351524
protected function newTable($table = null)
    {
        return new Table(
            static::$dbManager,
            $this->connectionName,
            $table ? : $this->tableName,
            static::$dbManager->getStructure($this->connectionName)
        );
    }
1040021
public static function getInstance(PDO $pdo, $table)
    {
        if (!self::$instance) {
            self::$instance = new self($pdo, $table);
        }
        return self::$instance;
    }
1244952
public function from(string $table) {
		// set the table
		list($this->Table) = Query\Convert::columnToPlaceholder($this->Quote ,$table);	
		// return self to the next method
		return $this;
	}
151132
public function buildQuery(Builder $query = null): Builder
    {
        $query = $this->getSubQuery($this->meta, $query, $this->conditions['rules'], $this->conditions['condition']);

        if ($this->offset > 0) {
            $query->offset($this->offset);
        }
        if ($this->limit > 0) {
            $query->limit($this->limit);
        }

        return $query;
    }
845299
protected function getTable($table = '')
    {
        if (empty($table))
        {
            switch (config('auth.driver'))
            {
                case 'eloquent':
                    $table = $this->getTableByModelClass(config('auth.model'));
                    break;
                case 'database':
                default:
                    $table = config('auth.table');
                    break;
            }
        }

        return $table;
    }
185050
public function getDropTableSql($table)
    {
        $table = $this->buildRealTableName($table);
        return $this->getSchema()->getDropTableSql($table);
    }
996106
public function getIndexes($table): ?array
	{
		return $this->driverQuery($this->getSql()->indexList($this->prefixTable($table)), FALSE);
	}