Load the metadata for a table.

@param Table $table
773342
protected function loadMetadataForTable(Table $table)
    {
        $tblName = $table->getName();

        if (isset($this->defaultAliases[$tblName])) {
            $className = $this->defaultAliases[$tblName];
        } else {
            $className = $tblName;
            $this->unmapped[] = $tblName;
        }

        $contentKey = $this->getContentTypeFromAlias($table->getOption('alias'));
        $this->metadata[$className] = [];
        $this->metadata[$className]['identifier'] = $table->getPrimaryKey();
        $this->metadata[$className]['table'] = $table->getName();
        $this->metadata[$className]['boltname'] = $contentKey;
        if (isset($this->contenttypes[$contentKey]['class'])) {
            $this->metadata[$className]['class'] = $this->contenttypes[$contentKey]['class'];
        }
        foreach ($table->getColumns() as $colName => $column) {
            $mapping = [
                'fieldname'        => $column->getName(),
                'attribute'        => $this->camelize($column->getName()),
                'type'             => $column->getType()->getName(),
                'fieldtype'        => $this->getFieldTypeFor($contentKey, $column),
                'length'           => $column->getLength(),
                'nullable'         => !$column->getNotnull(),
                'platformOptions'  => $column->getPlatformOptions(),
                'precision'        => $column->getPrecision(),
                'scale'            => $column->getScale(),
                'default'          => $column->getDefault(),
                'columnDefinition' => $column->getColumnDefinition(),
                'autoincrement'    => $column->getAutoincrement(),
            ];

            $this->metadata[$className]['fields'][$colName] = $mapping;

            if (isset($this->contenttypes[$contentKey]['fields'][$colName])) {
                $this->metadata[$className]['fields'][$colName]['data'] = $this->contenttypes[$contentKey]['fields'][$colName];
            }
        }

        // This loop checks the contenttypes definition for any non-db fields and adds them.
        if ($contentKey && isset($this->contenttypes[$contentKey])) {
            $this->setRelations($contentKey, $className);
            $this->setIncomingRelations($contentKey, $className);
            $this->setTaxonomies($contentKey, $className);
            $this->setTemplatefields($contentKey, $className);
            $this->setRepeaters($contentKey, $className);
        }

        foreach ($this->getAliases() as $alias => $tablename) {
            if (array_key_exists($tablename, $this->metadata)) {
                $this->metadata[$alias] = $this->metadata[$tablename];
            } elseif (
                array_key_exists($tablename, $this->defaultAliases) &&
                array_key_exists($this->defaultAliases[$tablename], $this->metadata)
            ) {
                $this->metadata[$alias] = $this->metadata[$this->defaultAliases[$tablename]];
            }
        }
    }
1132666
public function getTableKeys($table)
	{
		// Get the details columns information
		$this->setQuery('SHOW KEYS FROM ' . $this->quoteName($table));
		$keys = $this->loadObjectList('Key_name');

		return $keys;
	}
734911
def table_metadata(self, database, table):
        ""
        return (self.metadata("databases") or {}).get(database, {}).get(
            "tables", {}
        ).get(
            table, {}
        )
542406
public function removeTable(\TechPromux\DynamicQueryBundle\Entity\MetadataTable $table)
    {
        $this->tables->removeElement($table);
    }
427071
public function loadTable($table)
    {
        $file = $this->path . '/' . $table . '.json';
        if (is_file($file)) {
            $data = file_get_contents($file);
            if (!$data) {
                return $this->blankTable();
            }

            if (!$data = @json_decode($data, true, 512)) {
                throw new Exception("Unable to parse table file '{$table}.json'");
            }

            return  $data;
        }

        return $this->blankTable();
    }
987455
public function getTableInfo($table)
    {
        if (!$this->tableExists($table)) {
            return null;
        }
        
        $rtable = static::buildRealTableName($table, true);
        $key = 'db/tableinfo/' . $rtable;
        $data = static::getCache()->get($key);
        
        if (!$data) {
            $data = ['table_name' => $table];
            $data['fields'] = $this->getColumns($table);
            $pk = [];
            foreach ($data['fields'] as $key => $val) {
                if($val['is_primary']) {
                    $pk[] = $key;
                }
            }
            $data['primary_key'] = $pk ? $pk[0] : null;
            
            static::getCache()->set($key, $data);
        }
        
        return $data;
    }
1125992
public function initialize(Table $table)
    {
        $this->table = $table;

        if (!$this->builder instanceof ActionBuilder) {
            $this->builder = new ActionBuilder($this->table);
        }
    }
319570
function metadata($tablename) {
        $sql = "SHOW COLUMNS FROM ".$tablename;
        $q = self::queryReturnError($sql);
        if ( $q->success ) {
            return $q->fetchAll();
        } else {
            return false;
        }
    }
876773
public function addTableObject(TableMap $table)
    {
        $table->setDatabaseMap($this);
        $this->tables[$table->getName()] = $table;
        $this->tablesByPhpName[$table->getClassname()] = $table;
    }
740767
public function loadAssets($table)
    {
        if (TL_MODE !== 'BE' || !is_array($GLOBALS['TL_DCA'][$table]['fields'])) {
            return;
        }

        foreach ($GLOBALS['TL_DCA'][$table]['fields'] as $field) {
            if ($field['inputType'] === 'fineUploader') {
                FineUploaderWidget::includeAssets();
                break;
            }
        }
    }
6116
def get_table_metadata(engine, table):
    
    metadata = MetaData()
    metadata.reflect(bind=engine, only=[table])
    table_metadata = Table(table, metadata, autoload=True)
    return table_metadata
222006
public function refreshTableSchema($table)
	{
		echo "    > refresh table $table schema cache ...";
		$time=microtime(true);
		$this->getDbConnection()->getSchema()->getTable($table,true);
		echo " done (time: ".sprintf('%.3f', microtime(true)-$time)."s)\n";
	}
1269738
def load_data_table(table_name, meta_file, meta):
    
    for table in meta['tables']:
        if table['name'] == table_name:
            prefix = os.path.dirname(meta_file)
            relative_path = os.path.join(prefix, meta['path'], table['path'])
            return pd.read_csv(relative_path), table
534595
public function describeTable($table)
    {
        if (null !== $this->logger) {
            $this->log('Describe table '.$table);
        }

        $parameters = array(
            'TableName' => $table,
        );

        if (null !== $this->logger) {
            $this->log('DescribeTable request paramaters : '.print_r($parameters, true), Logger::DEBUG);
        }

        $response = $this->connector->describeTable($parameters);

        if (null !== $this->logger) {
            $this->log('DescribeTable request response : '.print_r($response, true), Logger::DEBUG);
        }

        $tableDescription = new Table\TableDescription();
        $tableDescription->populateFromDynamoDB($response['Table']);

        return $tableDescription;
    }
579318
public function setTable($table)
    {
        $this->table = $table;
        $this->getQuery()->table($table);

        return $this;
    }
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;
    }
516384
public function addTableObject(TableMap $table)
    {
        $table->setDatabaseMap($this);
        $this->tables[$table->getName()] = $table;
        $phpName = $table->getClassName();
        if ('\\' !== $phpName[0]) {
            $phpName = '\\' . $phpName;
        }
        $this->tablesByPhpName[$phpName] = $table;
    }