Get update queries.

@return string[]
484466
protected function getUpdateQueries()
    {
        $schema = new SchemaTool($this->em);

        $metadatas = $this->em->getMetadataFactory()->getAllMetadata();

        // Insure the name of altered tables are quoted according to the platform
        $this->em->getEventManager()->addEventListener(Events::onSchemaAlterTable, $this);

        $sqls = $schema->getUpdateSchemaSql($metadatas, true);

        return $sqls;
    }
933092
public function getAllForInsertUpdate()
    {
        $data = [];
        foreach ($this->_values as $key => $value) {
            if ($key === '_id' || $key === '_rev') {
                continue;
            }

            if ($key === '_key' && $value === null) {
                // key value not yet set
                continue;
            }
            $data[$key] = $value;
        }
        if ($this->_key !== null) {
            $data['_key'] = $this->_key;
        }

        return $data;
    }
915376
protected function getUpdateList()
    {
        $start = [];
        $updates = update_get_update_list();
        foreach ($updates as $module => $update) {
            $start[$module] = $update['start'];
        }

        return $start;
    }
469108
protected function _getQueryLogs()
    {
        $sources = $this->_getSources();

        $queryLog = [];
        foreach ($sources as $source) {
            $logger = $this->_getSource($source)->getLogger();
            if (method_exists($logger, 'getLogs')) {
                $queryLog[$source] = $logger->getLogs();
            }
        }

        return $queryLog;
    }
1041075
public function getQueryAsArray()
        {
            $query = $this->getQuery();
            $querryArray = array();

            if ($query !== false) {
                parse_str($query, $querryArray);
            }

            return $querryArray;
        }
147170
public function getQueries()
    {
        return array_merge(
            $this->createNamespaceQueries,
            $this->createTableQueries,
            $this->createSequenceQueries,
            $this->createFkConstraintQueries
        );
    }
551430
private function getPlatformUpdates()
    {
        /** @var ContainerHelper $helper */
        $helper = $this->getHelper('container');
        $app = $helper->getContainer();
        $platform = $app['db']->getDatabasePlatform();
        $platformName = $platform->getName();
        $schemaTables = $app['schema']->getSchemaTables();
        $tables = MutableBag::from([]);
        /** @var Table $table */
        foreach ($schemaTables as $table) {
            $tables[] = $table->getName();
        }

        if ($platformName === 'sqlite') {
            return MutableBag::from(['VACUUM', 'ANALYZE']);
        }

        if ($platformName === 'postgresql') {
            $updates = MutableBag::from(['VACUUM(FULL, ANALYZE)']);
            /** @var string $table */
            foreach ($tables as $table) {
                $updates[] = 'REINDEX TABLE ' . $table;
            }

            return $updates;
        }

        if ($platformName === 'mysql') {
            return MutableBag::from([
                'ANALYZE TABLE ' . $tables->join(', '),
                'OPTIMIZE TABLE ' . $tables->join(', '),
            ]);
        }

        throw new RuntimeException(sprintf('Unsupported platform: %s', $platformName));
    }
643710
private function getSearchQuery()
    {
        $queries = [];

        foreach ($this->queryProviders as $queryProvider) {
            $queries[] = $queryProvider->getQuery();
        }

        return array_filter($queries);
    }
1219745
private function fetchMigrations()
    {
        if ( ! isset($this->migrations)) {
            return null;
        }

        if (empty($this->migrations)) {
            return array();
        }

        $migrations = array();
        $connection = $this->entityManager->getConnection();
        $driver     = $connection->getDatabasePlatform()->getName();

        foreach ($this->migrations as $migration) {
            $files = glob($migration . '/*.sql');

            if (empty($files)) {
                $files = glob($migration . '/' . $driver . '/*.sql');

                if (empty($files)) {
                    continue;
                }
            }

            foreach ($files as $file) {
                $version = basename($file, '.sql');

                if (preg_match('~^[vV]([^_]+)_~', $version, $matches)) {
                    $version = $matches[1];
                }

                $migrations[$version] = $file;
            }
        }

        uksort($migrations, 'version_compare');

        return $migrations;
    }
648502
protected function _buildUpdate()
        {
            $query = [];
            $query[] = "UPDATE {$this->_quoteIdentifier($this->_table_name)} SET";

            $field_list = [];

            foreach ($this->_dirty_fields as $key => $value) {
                if(!Arrays::exists($key, $this->_expr_fields)) {
                    $value = '?';
                }

                $field_list[] = "{$this->_quoteIdentifier($key)} = $value";
            }

            $query[] = join(", ", $field_list);
            $this->_addIdColumnConditions($query);

            return join(" ", $query);
        }
834602
protected function getStrictRequestParameters()
    {
        $data = [];

        foreach ($this->strictUpdateKeys as $value)
            if (request()->has($value))
                $data[$value] = request($value);

        return $data;
    }
946842
public function getLastQueryStrings() {
    $result = [];
    foreach ($this->queries as $query) {
      $result[] = $query->getLastQueryString();
    }
    return $result;
  }
809058
public function getUpdateType()
    {
        $update = $this->data;
        if (isset($update['inline_query'])) {
            return self::INLINE_QUERY;
        }
        if (isset($update['callback_query'])) {
            return self::CALLBACK_QUERY;
        }
        if (isset($update['edited_message'])) {
            return self::EDITED_MESSAGE;
        }
        if (isset($update['message']['text'])) {
            return self::MESSAGE;
        }
        if (isset($update['message']['photo'])) {
            return self::PHOTO;
        }
        if (isset($update['message']['video'])) {
            return self::VIDEO;
        }
        if (isset($update['message']['audio'])) {
            return self::AUDIO;
        }
        if (isset($update['message']['voice'])) {
            return self::VOICE;
        }
        if (isset($update['message']['contact'])) {
            return self::CONTACT;
        }
        if (isset($update['message']['location'])) {
            return self::LOCATION;
        }
        if (isset($update['message']['reply_to_message'])) {
            return self::REPLY;
        }
        if (isset($update['message']['animation'])) {
            return self::ANIMATION;
        }
        if (isset($update['message']['document'])) {
            return self::DOCUMENT;
        }
        if (isset($update['channel_post'])) {
            return self::CHANNEL_POST;
        }

        return false;
    }
1092804
public function fetch(): array
    {
        $sql = $this->builder->buildSql();
        $this->builder = new QueryBuilder($this->pdo);
        return $this->fetchBySql($sql);
    }
308931
public function get(): array
    {
        try {
            $query = $this->apply($this->database->getTablePrefixer());
            $compiled = $this->database->getGrammar()->compileSelect($query);
            return $this->database->select($compiled->getSQL(), $compiled->getBindings());
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
1100564
protected function getDatabaseQueries()
    {
        $queries = [];
        foreach ($this->logger->queries as $query) {
            $queries[] = [
                'query'      => $this->formatter->format($this->connection->getDatabasePlatform(), $query['sql'], $query['params']),
                'duration'   => $query['executionMS'] * 1000,
                'connection' => $this->connection->getDriver()->getName()
            ];
        }

        return $queries;
    }
441993
public function dbupdate() {
		BLog::addToLog('[Items.Item.' . $this->tableName . ']: Updating data...');
		if (empty($this->id)) {
			return false;
		}
		if (!$db = \Brilliant\BFactory::getDBO()) {
			return false;
		}
		//
		$this->modified = new \Brilliant\BDateTime();
		//Get query
		$qr = $this->dbupdatequery();
		//Running query...
		$q = $db->query($qr);
		if (empty($q)) {
			return false;
		}
		//Updating cache...
		$this->updateCache();
		//Return result
		return true;
	}