Truncates the search index table.

@return bool true if success
511876
public function truncateTable()
    {
        $connection = $this->_em->getConnection();
        $dbPlatform = $connection->getDatabasePlatform();
        $connection->beginTransaction();
        try {
            $q = $dbPlatform->getTruncateTableSql($this->getSearchIndexTable());
            $connection->executeUpdate($q);
            $connection->commit();

            return true;
        } catch (\Exception $e) {
            $connection->rollback();

            return false;
        }
    }
511609
public function truncateTables()
    {
        $dbName = env('DB_DATABASE');

        // Get all tables list, except migrations table
        $tables = DB::select('SHOW TABLES WHERE `Tables_in_'.$dbName.'` != ?', ['migrations']);

        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
        foreach ($tables as $table) {
            DB::table($table->{'Tables_in_' . $dbName})->truncate();
        }
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
    }
1025091
public function truncate_index($collection)
    {
        $this->get_index();
        asort($this->indexes[$collection]);
        reset($this->indexes[$collection]);
        $key = key($this->indexes[$collection]);

        $invalid = array("{$collection}" => $key);
        return $this->clear_indexes($invalid);
    }
1005415
public function flush()
    {
        $query = sprintf('TRUNCATE `%s`', $this->table);
        return $this->pdo->exec($query) !== false;
    }
381124
protected function dropTables()
    {
        $tables = $this->db->query(
            'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "BASE_TABLE"',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        // Disable foreign key checks -- we are wiping the database on purpose
        $this->db->query(
            'SET FOREIGN_KEY_CHECKS = 0',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        foreach ($tables as $table) {
            $this->db->query(
                'DROP TABLE '.reset($table),
                DbAdapter::QUERY_MODE_EXECUTE
            );
        }

        // Re-enable foreign key checks
        $this->db->query(
            'SET FOREIGN_KEY_CHECKS = 1',
            DbAdapter::QUERY_MODE_EXECUTE
        );
    }
967381
public function truncateTable($table)
    {
        $query = "TRUNCATE " . $this->getName($table->getName());
        $this->db->exec($query);
        return $this;
    }
346069
public function truncate()
    {
        foreach ($this->tables as $table) {
            $this->db->query("DELETE FROM $table");
        }

        $this->tables = array();
    }
1224148
protected function truncate_after_seek(): void
    {
        if ($this->position > strlen($this->string)) {
            $this->stream_truncate($this->position);
        }
    }
337528
public function truncate(int $size): bool
    {
        $this->size = $size;
        foreach (array_filter(array_keys($this->content),
                              function($pos) use ($size)
                              {
                                  return $pos >= $size;
                              }
                ) as $removePos) {
            unset($this->content[$removePos]);
        }

        return true;
    }
476245
public function deleteIndex()
	{
		try {
			$this->getClient()->indices()->delete(array(
				'index' => $this->name,
			));
		} catch (\Elasticsearch\Common\Exceptions\Missing404Exception $e) {
			return false;
		}
		
		return true;
	}
57035
public function closeCursor()
    {
        if (!$this->_stmt) {
            return false;
        }
        db2_free_stmt($this->_stmt);
        $this->_stmt = false;
        return true;
    }
24619
public function truncate()
    {
        foreach ($this->grammar->compileTruncate($this) as $sql => $bindings) {
            $this->connection->statement($sql, $bindings);
        }
    }
569072
public function delete()
    {
        if ($this->getPk() === null) {
            return false;
        }
        $query = $this->_queryClass;
        $bindKey = PdoBindHelper::generateBindKey();
        $result = DbConnector::getAdapter()->delete((new $query)->getTableName(), $this->_pkWhere($bindKey), [$bindKey => $this->getInitialStateValue('id')]);
        return ($result > 0) ? true : false;
    }
891081
public function delete_index(string $table, string $key): bool
	{
		if ( ( $table = $this->table_full_name($table, 1) ) && bbn\str::check_name($key) ){
			return (bool)$this->db->query("ALTER TABLE $table DROP INDEX `$key`");
		}
		return false;
	}
1327716
public void truncate() {
        Log.info("Truncating index");
        try {
            indexWriter.deleteAll();
        } catch (IOException e) {
            Log.error(e, "Error while truncating index");
            throw new RuntimeException(e);
        }
    }
1102471
public function truncateLaratrustTables()
    {
        DB::statement('SET FOREIGN_KEY_CHECKS = 0');
        DB::table('permission_role')->truncate();
        DB::table('permission_user')->truncate();
        DB::table('role_user')->truncate();
        \App\User::truncate();
        \Simoja\Laramin\Models\Role::truncate();
        \Simoja\Laramin\Models\Permission::truncate();
        DB::statement('SET FOREIGN_KEY_CHECKS = 1');
    }
809595
public function deleteIndex(): bool
    {
        $indexParams = [
            'index'   => $this->index,
            'timeout' => '5s',
        ];

        $this->client->indices()->delete($indexParams);

        $response = $this->client->cluster()->health([
            'index'           => $this->index,
            'wait_for_status' => 'yellow',
            'timeout'         => '5s',
        ]);

        return isset($response['status']) && $response['status'] !== 'red';
    }