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

        $cdefs = (array)$this->query('pragma table_info('.$this->quoteVal($this->px.$tablename).')');
        if (empty($cdefs)) {
            return null;
        }

        $columns = [];
        $pk = [];
        foreach ($cdefs as $cdef) {
            $column = [
                'type' => $this->columnTypeString($cdef['type']),
                'required' => force_bool($cdef['notnull']),
            ];
            if ($cdef['pk']) {
                $pk[] = $cdef['name'];
                if (strcasecmp($cdef['type'], 'integer') === 0) {
                    $column['autoincrement'] = true;
                } else {
                    $column['primary'] = true;
                }
            }
            if ($cdef['dflt_value'] !== null) {
                $column['default'] = $cdef['dflt_value'];
            }
            $columns[$cdef['name']] = $column;
        }
        $tdef = ['columns' => $columns];
        if (!empty($pk)) {
            $tdef['indexes'][Db::INDEX_PK] = [
                'columns' => $pk,
                'type' => Db::INDEX_PK
            ];
        }
        $this->tables[$tablename] = $tdef;
        return $columns;
    }
protected function getColumns($tablename = '') {
        if (!$tablename) {
            $tablenames = $this->getTablenames();
            foreach ($tablenames as $tablename) {
                $this->getColumns($tablename);
            }
        }

        $cdefs = (array)$this->query('pragma table_info('.$this->quoteVal($this->px.$tablename).')');
        if (empty($cdefs)) {
            return null;
        }

        $columns = [];
        $pk = [];
        foreach ($cdefs as $cdef) {
            $column = [
                'type' => $this->columnTypeString($cdef['type']),
                'required' => force_bool($cdef['notnull']),
            ];
            if ($cdef['pk']) {
                $pk[] = $cdef['name'];
                if (strcasecmp($cdef['type'], 'integer') === 0) {
                    $column['autoincrement'] = true;
                } else {
                    $column['primary'] = true;
                }
            }
            if ($cdef['dflt_value'] !== null) {
                $column['default'] = $cdef['dflt_value'];
            }
            $columns[$cdef['name']] = $column;
        }
        $tdef = ['columns' => $columns];
        if (!empty($pk)) {
            $tdef['indexes'][Db::INDEX_PK] = [
                'columns' => $pk,
                'type' => Db::INDEX_PK
            ];
        }
        $this->tables[$tablename] = $tdef;
        return $columns;
    }
Get the columns for tables and put them in {MySqlDb::$tables}.

@param string $tablename The table to get the columns for or blank for all columns.
@return array|null Returns an array of columns if {@link $tablename} is specified, or null otherwise.