Gets info of the fields from the table.
506423
public function discoverFields() {
    if (!empty($this->fields)) {
      return; // Already configured.
    }

    $sm = $this->db()->getSchemaManager();
    $columns = $sm->listTableColumns($this->table);
    foreach ($columns as $column) {
      $this->fields[$column->getName()] = array(
        'name' => $column->getName(),
        'type' => $column->getType(),
      );
    }

    try {
      $this->fks = $sm->listTableForeignKeys($this->table);
    } catch (\DBALException $e) {
      //Platform does not support foreign keys.
      $this->fks = array();
    }
  }
1354307
public function getFields($table,$onlyField=true)
    {
        $this->sql = 'SHOW full columns FROM ' .$this->tablePre. $table;
        $stmt = $this->execute();
        $fields = array();
        $info = $stmt->fetchAll();
        if(!$onlyField) return $info;
        foreach ($info as $value) {
            $fields[] = $value['Field'];
        }
        return $fields;
    }
82451
public function list_fields($table)
	{
		// Is there a cached result?
		if (isset($this->data_cache['field_names'][$table]))
		{
			return $this->data_cache['field_names'][$table];
		}

		if (($result = $this->query('PRAGMA TABLE_INFO('.$this->protect_identifiers($table, TRUE, NULL, FALSE).')')) === FALSE)
		{
			return FALSE;
		}

		$this->data_cache['field_names'][$table] = array();
		foreach ($result->result_array() as $row)
		{
			$this->data_cache['field_names'][$table][] = $row['name'];
		}

		return $this->data_cache['field_names'][$table];
	}
1122504
public function getTableInfo($table=null)
    {
        if (!$table) {
            if (!isset($this['fields'])) {
                $table = $this->getTableName();
                $info = $this->getDb()->getTableInfo($table);
                if ($info) $this->setOption($info);
            }
            return $this->options;
        } else {
            return $this->getDb()->getTableInfo($table);
        }
    }
1261556
def get_fields(self):
        
        return [x for x in self.static_fields] + [x
                                                  for x in self.instance_fields]
640886
public function getFields()
    {
        $ownerClass = get_class($this->owner);
        $ownerTable = $ownerClass::tableName();
        if (!isset(self::$_fields[$ownerTable])) {
            self::$_fields[$ownerTable] = [];
            $_f = ['deletedField', 'deletedByField', 'createdField', 'createdByField', 'modifiedField', 'modifiedByField'];
            $schema = $ownerClass::getTableSchema();
            foreach ($_f as $field) {
                if (isset($schema->columns[$this->{$field}])) {
                    self::$_fields[$ownerTable][$field] = $this->{$field};
                }
            }
        }

        return self::$_fields[$ownerTable];
    }
1159328
protected function getInformation()
    {
        $ignoredColumns = [
            'id',
            'identifier',
            'created_at',
            'updated_at',
            'deleted_at',
        ];
        $columns = [];

        $dbColumns = $this->model->getConnection()->select('SHOW COLUMNS FROM ' . $this->model->getTable());

        foreach ($dbColumns as $key => $value) {
            if (!in_array($value->Field, $ignoredColumns)) {
                $columns[$value->Field] = null;
            }
        }

        foreach ($columns as $key => $value) {
            if ($key == 'password') {
                $columns[$key] = $this->password();
            } else {
                $ask = $this->ask('Enter value for ' . ucwords(str_replace('_', '', $key)));
                if ($ask == 'null') {
                    $ask = null;
                }
                $columns[$key] = $ask;
            }
        }

        $columns['password'] = Hash::make($columns['password']);

        $this->checkAndConfirm($columns);

        $this->persist($columns);
    }
124391
protected function _getFields(Table $table)
    {
        $fields = explode(',', $this->args[1]);
        foreach ($fields as $field) {
            if (!$table->hasField($field)) {
                $this->abort(sprintf('Table `%s` is missing the field `%s`.', $table->table(), $field));
            }
        }

        return $fields;
    }
31535
protected function getFields()
  {
    $fields = $this->db->getTableColumns($this->tbl);
    if ( empty($fields) ){
      throw new TableException('Table columns not found');
    }
    
    return $fields;
  }
877557
def _get_fields(self, table_name, **kwargs):
        """"""
        ret = {}
        query_str = []
        query_args = ['f', table_name]

        # I had to brush up on my join knowledge while writing this query
        # https://en.wikipedia.org/wiki/Join_(SQL)
        #
        # other helpful links
        # https://wiki.postgresql.org/wiki/Retrieve_primary_key_columns
        # https://www.postgresql.org/docs/9.4/static/catalog-pg-attribute.html
        # https://www.postgresql.org/docs/9.3/static/catalog-pg-type.html
        # 
        # another approach
        # http://dba.stackexchange.com/questions/22362/how-do-i-list-all-columns-for-a-specified-table
        # http://gis.stackexchange.com/questions/94049/how-to-get-the-data-type-of-each-column-from-a-postgis-table
        query_str.append('SELECT')
        query_str.append(',  '.join([
            'a.attnum',
            'a.attname',
            'a.attnotnull',
            't.typname',
            'i.indisprimary',
            #'s.conname',
            #'pg_get_constraintdef(s.oid, true) as condef',
            'c.relname AS confrelname',
        ]))
        query_str.append('FROM')
        query_str.append('  pg_attribute a')
        query_str.append('JOIN pg_type t ON a.atttypid = t.oid')
        query_str.append('LEFT JOIN pg_index i ON a.attrelid = i.indrelid')
        query_str.append('  AND a.attnum = any(i.indkey)')
        query_str.append('LEFT JOIN pg_constraint s ON a.attrelid = s.conrelid')
        query_str.append('  AND s.contype = {} AND a.attnum = any(s.conkey)'.format(self.val_placeholder))
        query_str.append('LEFT JOIN pg_class c ON s.confrelid = c.oid')
        query_str.append('WHERE')
        query_str.append('  a.attrelid = {}::regclass'.format(self.val_placeholder))
        query_str.append('  AND a.attisdropped = False')
        query_str.append('  AND a.attnum > 0')
        query_str.append('ORDER BY a.attnum ASC')

        query_str = os.linesep.join(query_str)
        fields = self.query(query_str, *query_args, **kwargs)

        pg_types = {
            "float8": float,
            "timestamp": datetime.datetime,
            "int2": int,
            "int4": int,
            "int8": long,
            "numeric": decimal.Decimal,
            "text": str,
            "bpchar": str,
            "varchar": str,
            "bool": bool,
            "date": datetime.date,
            "blob": bytearray,
        }

        # the rows we can set: field_type, name, field_required, min_size, max_size,
        #   size, unique, pk, <foreign key info>
        # These keys will roughly correspond with schema.Field
        for row in fields:
            field = {
                "name": row["attname"],
                "field_type": pg_types[row["typname"]],
                "field_required": row["attnotnull"],
                "pk": bool(row["indisprimary"]),
            }

            if row["confrelname"]:
                # TODO -- I can't decide which name I like
                field["schema_table_name"] = row["confrelname"]
                field["ref_table_name"] = row["confrelname"]

            ret[field["name"]] = field

        return ret
654362
def get_table_description(self, cursor, table_name):
        ""
        # As cursor.description does not return reliably the nullable property,
        # we have to query the information_schema (#7783)
        cursor.execute("""
            SELECT column_name, is_nullable, column_default
            FROM information_schema.columns
            WHERE table_schema = %s and table_name = %s""", [self.connection.schema_name, table_name])
        field_map = {line[0]: line[1:] for line in cursor.fetchall()}
        cursor.execute("SELECT * FROM %s LIMIT 1" % self.connection.ops.quote_name(table_name))
        return [FieldInfo(*((force_text(line[0]),) + line[1:6] +
                            (field_map[force_text(line[0])][0] == 'YES', field_map[force_text(line[0])][1])))
                for line in cursor.description]
353528
def get_fields(self):
        
        result = [key for key in self.__original_data__.keys()
                  if key not in self.__deleted_fields__]
        result.extend([key for key in self.__modified_data__.keys()
                       if key not in result and key not in self.__deleted_fields__])

        return result
199991
def values(self):
        
        return [getattr(self, c.name, None) for c in self.__table__._columns]
1325197
def get_field_info(self) -> FieldInfo:
        
        byte_buffer = self.game.UpdateFieldInfoFlatbuffer()

        if byte_buffer.size >= 4:  # GetRootAsGameTickPacket gets angry if the size is less than 4
            # We're counting on this copying the data over to a new memory location so that the original
            # pointer can be freed safely.
            proto_string = ctypes.string_at(byte_buffer.ptr, byte_buffer.size)
            self.game.Free(byte_buffer.ptr)  # Avoid a memory leak
            self.game_status(None, RLBotCoreStatus.Success)
            return FieldInfo.GetRootAsFieldInfo(proto_string, 0)
28668
def process_fields(self, fields):
		""""""
		
		result = []
		strip = ''.join(self.PREFIX_MAP)
		
		for field in fields:
			direction = self.PREFIX_MAP['']
			
			if field[0] in self.PREFIX_MAP:
				direction = self.PREFIX_MAP[field[0]]
				field = field.lstrip(strip)
			
			result.append((field, direction))
		
		return result
993752
def fields(self):
        """"""
        return (self.attributes.values() + self.lists.values()
                + self.references.values())
369821
def get_field_info(self, field):
        """"""
        field_info = OrderedDict()
        for attr in ('required', 'read_only', 'default', 'label'):
            field_info[attr] = getattr(field, attr)
        if field_info['default'] is empty:
            field_info['default'] = None
        if hasattr(field, 'immutable'):
            field_info['immutable'] = field.immutable
        field_info['nullable'] = field.allow_null
        if hasattr(field, 'choices'):
            field_info['choices'] = [
                {
                    'value': choice_value,
                    'display_name': force_text(choice_name, strings_only=True)
                }
                for choice_value, choice_name in field.choices.items()
            ]
        many = False
        if isinstance(field, DynamicRelationField):
            field = field.serializer
        if isinstance(field, ListSerializer):
            field = field.child
            many = True
        if isinstance(field, ModelSerializer):
            type = 'many' if many else 'one'
            field_info['related_to'] = field.get_plural_name()
        else:
            type = self.label_lookup[field]

        field_info['type'] = type
        return field_info