Return the schema extension object.

@param string              $name

@param ConnectionInterface $conn

@return DbSchemaInterface
552656
public function getSchemaExtension($name, ConnectionInterface $conn)
    {
        if (isset($this->extensions[$name])) {
            return call_user_func($this->extensions[$name], $conn);
        }

        return null;
    }
1229918
public function getConnectionConfig($name = null) {
		if (is_null($name)) {
			$name = $this->defaultConfigName;
		}

		if (isset($this->connectionConfigs[$name])) {
			return $this->connectionConfigs[$name];
		}

		return null;
	}
826563
public function getConnection($name)
    {
        if (!$this->connectionSettings->has($name)) {
            throw new BadArgumentException('Connection with name ":name" not defined in configuration file ":file"', [
                'name' => $name, 'file' => ServiceLocator::instance()->getConfiguration()->getIdentity(),
            ]);
        }
        
        $this->connect($name);
        
        return static::$connections[$name];
    }
122104
protected function getConnectionByName($name)
    {
        if (array_key_exists($name, $this->connectionByName)) {
            return $this->connectionByName[$name];
        }

        $event = clone $this->getManagerRegistryResourceEventPrototype();
        $event->setName(ManagerRegistryResourceEvent::RESOLVE_CONNECTION_EVENT);
        $event->setResourceName($name);
        $event->setTarget($this);


        $resultsEvent = $this->getEventManager()->trigger($event, function ($connection) {
            return is_object($connection);
        });

        $connection = $resultsEvent->last();

        if (!is_object($connection)) {
            $errMsg = sprintf('Connection %s not found', $name);
            throw new Exception\ConnectionNotFoundException($errMsg);
        }

        $this->connectionByName[$name] = $connection;

        return $this->connectionByName[$name];
    }
1283630
protected function configure(Connection $connection, $name)
    {
        $connection->setName($name);

        if ($this->events && $this->app->bound('events')) {
            $connection->setEventDispatcher($this->app->make('events'));
        }

        return $connection;
    }
391575
public static function connection($name = null)
    {
        if (is_null($name) || strlen($name) == 0) {
            if (is_null(static::$name)) {
                static::$name = static::$config['default'];
            }

            $name = static::$name;
        }

        if (!isset(static::$config['connection'][$name])) {
            throw new ConnectionException('The connection "' . $name . '" is not defined.');
        }

        if ($name !== static::$name) {
            static::$adapter = null;
        }

        $config = static::$config['connection'][$name];

        static::$name = $name;

        if (static::$adapter === null) {
            if ($name == 'mysql') {
                static::$adapter = new MysqlAdapter($config);
            } elseif ($name == 'sqlite') {
                static::$adapter = new SqliteAdapter($config);
            } else {
                throw new ConnectionException('This driver is not praised');
            }

            static::$adapter->setFetchMode(static::$config['fetch']);
        }

        if (static::$adapter->getConnection() instanceof PDO && $name == static::$name) {
            return static::getInstance();
        }

        return static::getInstance();
    }
1107375
protected function _getSchema( $name )
	{
		if( !isset( $this->_schemas[$name] ) ) {
			return $this->_schema;
		}

		return $this->_schemas[$name];
	}
759516
public function table($tableName, $connectionName = null)
    {
        return new Table(
            $this,
            $connectionName,
            $tableName,
            $this->getStructure($connectionName)
        );
    }
501577
private function getLanguage(ConnectionInterface $conn) {

        if($conn->WebSocket instanceof \StdClass) {
            $language = $conn->WebSocket->request->getHeader('Accept-Language');
            $language = trim(strtoupper(substr($language, 0, 2)));

            return (empty($language) === false) ? $language :'Unknown';
        }
        throw new AppServiceException('Language not defined');
    }
446573
static public function retrieveRoot(ConnectionInterface $con = null)
    {
        $c = new Criteria(CategoryTableMap::DATABASE_NAME);
        $c->add(ChildCategory::LEFT_COL, 1, Criteria::EQUAL);

        return ChildCategoryQuery::create(null, $c)->findOne($con);
    }
171076
private function getDataExtension(string $extractName): DataExtensionInterface
    {
        return $this->dataExtensions->has($extractName) ? $this->dataExtensions->get($extractName) : $this->dataExtension;
    }
1082535
public function connection( $name = null )
	{
		list( $name, $type ) = $this->parseConnectionName( $name );

		// If we haven't created this connection, we'll create it based on the config
		// provided in the application. Once we've created the connections we will
		// set the "fetch mode" for PDO which determines the query return types.
		if ( !isset( $this->connections[$name] ) )
		{
			$connection = $this->makeConnection( $name );

			$this->setPdoForType( $connection, $type );

			$this->connections[$name] = $this->prepare( $connection );
		}

		return $this->connections[$name];
	}
1305278
public function getForeignKey($name)
    {
        if (!$this->hasForeignKey($name)) {
            throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $name);
        }

        return $this->foreignKeys[$name];
    }
1276648
public function connection($name = null)
	{
		list($database, $type) = $this->parseConnectionName($name);
		$name = $name ?: $database;

		// If we haven't created this connection, we'll create it based on the config
		// provided in the application. Once we've created the connections we will
		// set the "fetch mode" for PDO which determines the query return types.
		if (! isset($this->connections[$name]))
		{
			$this->connections[$name] = $this->configure(
				$this->makeConnection($database), $type
			);
		}

		return $this->connections[$name];
	}
356836
public function getTable($name)
    {
        if (!$this->hasTable($name)) {
            throw SchemaException::schemaTableDoesNotExist($this->getName(), $name);
        }

        return $this->tables[$name];
    }
745734
public function createDoctrineDBALSchemaManager(\Doctrine\DBAL\Connection $connection)
    {

        $em_default = $this->getEntityManager();

        $em_new = \Doctrine\ORM\EntityManager::create($connection, $em_default->getConfiguration());

        $schemaManager = $em_new->getConnection()->getSchemaManager();

        return $schemaManager;
    }
575234
protected function getSchema($connectionName = null)
    {
        $connectionName = $connectionName === null ? $this->connectionName : $connectionName;

        /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $schema */
        $schema = app('db')->connection($connectionName)->getDoctrineSchemaManager();
        // For MySQL
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
        // For Sqlite
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('long', 'integer');
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('bit', 'boolean');

        return $schema;
    }