src/Db/SqliteDb.php
protected function getIndexes($tablename = '') {
        if (!$tablename) {
            $tablenames = $this->getTablenames();
            foreach ($tablenames as $tablename) {
                $this->getIndexes($tablename);
            }
        }

        $pk = valr(['indexes', Db::INDEX_PK], $this->tables[$tablename]);

        // Reset the index list for the table.
        $this->tables[$tablename]['indexes'] = [];

        if ($pk) {
            $this->tables[$tablename]['indexes'][Db::INDEX_PK] = $pk;
        }

        $indexInfos = (array)$this->query('pragma index_list('.$this->quoteVal($this->px.$tablename).')');
        foreach ($indexInfos as $row) {
            $indexName = $row['name'];
            if ($row['unique']) {
                $type = Db::INDEX_UNIQUE;
            } else {
                $type = Db::INDEX_IX;
            }

            // Query the columns in the index.
            $columns = (array)$this->query('pragma index_info('.$this->quoteVal($indexName).')');

            $index = [
                'name' => $indexName,
                'columns' => array_column($columns, 'name'),
                'type' => $type
            ];
            $this->tables[$tablename]['indexes'][] = $index;
        }

        return $this->tables[$tablename]['indexes'];
    }
protected function getIndexes($tablename = '') {
        if (!$tablename) {
            $tablenames = $this->getTablenames();
            foreach ($tablenames as $tablename) {
                $this->getIndexes($tablename);
            }
        }

        $pk = valr(['indexes', Db::INDEX_PK], $this->tables[$tablename]);

        // Reset the index list for the table.
        $this->tables[$tablename]['indexes'] = [];

        if ($pk) {
            $this->tables[$tablename]['indexes'][Db::INDEX_PK] = $pk;
        }

        $indexInfos = (array)$this->query('pragma index_list('.$this->quoteVal($this->px.$tablename).')');
        foreach ($indexInfos as $row) {
            $indexName = $row['name'];
            if ($row['unique']) {
                $type = Db::INDEX_UNIQUE;
            } else {
                $type = Db::INDEX_IX;
            }

            // Query the columns in the index.
            $columns = (array)$this->query('pragma index_info('.$this->quoteVal($indexName).')');

            $index = [
                'name' => $indexName,
                'columns' => array_column($columns, 'name'),
                'type' => $type
            ];
            $this->tables[$tablename]['indexes'][] = $index;
        }

        return $this->tables[$tablename]['indexes'];
    }
Get the indexes from the database.

@param string $tablename The name of the table to get the indexes for or an empty string to get all indexes.
@return array|null