Get the table's schema object.

@param Schema $schema
@param string $aliasName
@param string $charset
@param string $collate

@return \Doctrine\DBAL\Schema\Table
558623
public function buildTable(Schema $schema, $aliasName, $charset, $collate)
    {
        $tableName = $this->tablePrefix . $aliasName;
        $this->table = $schema->createTable($tableName);
        $this->table->addOption('alias', $aliasName);
        $this->table->addOption('charset', $charset);
        $this->table->addOption('collate', $collate);
        $this->aliasName = $aliasName;
        $this->tableName = $this->table->getName();
        $this->addColumns();
        $this->addIndexes();
        $this->setPrimaryKey();
        $this->addForeignKeyConstraints();

        return $this->table;
    }
1173907
public function getColumns($table, $schema = null)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string')->test(2, 'string', 'null');
        
        $select = array(
            'columns.table_schema',
            'columns.column_name',
            'columns.ordinal_position',
            'columns.column_default',
            'columns.is_nullable',
            'columns.data_type',
            'columns.character_maximum_length',
            'columns.character_octet_length',
            'pg_class2.relname AS index_type');
        
        $where = array(
            "pg_attribute.attrelid = pg_class1.oid AND pg_class1.relname='".$table."'",
            'columns.column_name = pg_attribute.attname AND columns.table_name=pg_class1.relname',
            'pg_class1.oid = pg_index.indrelid AND pg_attribute.attnum = ANY(pg_index.indkey)',
            'pg_class2.oid = pg_index.indexrelid');
        
        if ($schema) {
            $where[1] .= ' AND columns.table_schema="'.$schema.'"';
        }
        
        $query = Select::i()
            ->select($select)
            ->from('pg_attribute')
            ->innerJoin('pg_class AS pg_class1', $where[0], false)
            ->innerJoin('information_schema.COLUMNS	AS columns', $where[1], false)
            ->leftJoin('pg_index', $where[2], false)
            ->leftJoin('pg_class AS pg_class2', $where[3], false)
            ->getQuery();
        
        $results = $this->query($query);
        
        $columns = array();
        foreach ($results as $column) {
            $key = null;
            if (strpos($column['index_type'], '_pkey') !== false) {
                $key = 'PRI';
            } else if (strpos($column['index_type'], '_key') !== false) {
                $key = 'UNI';
            }
            
            $columns[] = array(
                'Field'     => $column['column_name'],
                'Type'      => $column['data_type'],
                'Default'   => $column['column_default'],
                'Null'      => $column['is_nullable'],
                'Key'       => $key);
        }
        
        return $columns;
    }
64323
public function getGlobalElement( $qualifiedName )
	{
		if ( isset( $this->schemaElementCache[ $qualifiedName->__toString() ] ) )
		{
			return $this->schemaElementCache[ $qualifiedName->__toString() ];
		}

		$schemaElement = DOMSchemaElement::fromQName( $qualifiedName );
		$this->schemaElementCache[ $qualifiedName->__toString() ] = $schemaElement;
		return $schemaElement;
	}
894691
private function createTable(DBALSchema $schema, string $schemaName, TypeSchema $type)
    {
        $table = $schema->createTable($this->tableName($schemaName, $type->name()));
        $table->addColumn('id', 'guid');
        $table->setPrimaryKey(['id']);

        foreach ($type->getDefinitions(['id']) as $field => $definition) {
            $this->typeRegistry->map($schemaName, $table, $field, $definition);
        }
    }
277669
protected static function getSchema()
    {
        static $cache = null;
        if (!isset($cache)) {
            $schemaFile = __DIR__.'/doctrine-xml-0.5.xsd';
            $s = (is_file($schemaFile) && is_readable($schemaFile)) ? @file_get_contents($schemaFile) : false;
            if ($s === false) {
                throw new Exception('Failed to load the schema file '.$schemaFile);
            }
            $cache = $s;
        }

        return $cache;
    }
856493
public static function get_schema($name = 'default')
    {
        $connection = self::get_conn($name);
        if ($connection) {
            return $connection->getSchemaManager();
        }
        return null;
    }
144459
public function getSchema()
    {
        $schema = new Schema(['adapter' => $this->_adapter]);
        $tables = $this->getTables();
        foreach ($tables as $tableName) {
            $schema->addTable($this->getTable($tableName));
        }

        return $schema;
    }
972653
public function setSchema($schema)
    {
        $schema = func_get_args();
        
        $schema = "'".implode("','", $schema)."'";
        
        $query = $this->getUtilityQuery()->setSchema($schema);
        $this->query($query);
        
        return $this;
    }
209391
def get_schema(self, db_alias, entity):
        
        response = self.__app.native_api_call('metaql', 'schema/' + db_alias + '/' + entity, {}, self.__options, False, None, False, http_path="/api/v1/meta/", http_method="GET")
        return json.loads(response.text)
1107375
protected function _getSchema( $name )
	{
		if( !isset( $this->_schemas[$name] ) ) {
			return $this->_schema;
		}

		return $this->_schemas[$name];
	}
1099385
public static function fromSchemaType( $qname )
	{
		$types = SchemaTypes::getInstance();
		$type = $types->getType( "{$qname->prefix}:{$qname->localName}" );

		if ( ! $type ) return null;

		$datatype = new DOMSchemaDatatype( "{$qname->prefix}:{$qname->localName}" );
		$result = new DOMSchemaSimpleType( $qname, $datatype );
		return $result;
	}
423160
public function setSchemaDescription($schemaDescription, $locale = null)
    {
        $this->translate($locale, false)->setSchemaDescription($schemaDescription);
        $this->mergeNewTranslations();

        return $this;
    }
1374500
public static function definition($schema = null)
    {
        if (func_num_args()) {
            if (is_string($schema)) {
                static::$_definition = $schema;
            } elseif($schema) {
                static::$_definitions[static::class] = $schema;
            } else {
                unset(static::$_definitions[static::class]);
            }
            return;
        }
        $self = static::class;
        if (isset(static::$_definitions[$self])) {
            return static::$_definitions[$self];
        }
        $conventions = static::conventions();
        $config = [
            'connection'  => static::$_connection,
            'conventions' => $conventions,
            'class'       => $self,
            'locked'      => Document::class !== $self
        ];
        $config += ['source' => $conventions->apply('source', $self)];

        $class = static::$_definition;
        $schema = static::$_definitions[$self] = new $class($config);
        static::_define($schema);
        return $schema;
    }
452522
public function visitSchema(Schema $schema)
    {
        return new Schema(
            $this->transformConstraintArray($schema->constraints()),
            $schema->defaultValue(),
            $schema->title(),
            $schema->description()
        );
    }
1178796
public function setSchemaName($schemaName)
    {
        if (trim($schemaName) == '') {
            $schemaName = null;
        }
        $this->schemaName = $schemaName;

        return $this;
    }
587174
public static function createContent(SchemaInterface $schema, AbstractTable $table): self
    {
        $context = new self();
        $context->class = $schema->getClass();
        $context->database = $schema->getDatabase();
        $context->table = $schema->getTable();
        $context->role = $schema->getRole();

        $context->schema = $table;

        return $context;
    }
1186409
private static function getSchemaClassName($schemaName)
    {
        // Upgrade from pre 2.0.4
        if (strtolower($schemaName) == 'myisam'
            || empty($schemaName)) {
            $schemaName = self::DEFAULT_SCHEMA;
        }

        $class = str_replace(' ', '\\', ucwords(str_replace('_', ' ', strtolower($schemaName))));
        return '\Piwik\Db\Schema\\' . $class;
    }