src/ConnectionManager.php
public function connect(\stdClass $params): QueryBuilderInterface
	{
		list($dsn, $dbtype, $params, $options) = $this->parseParams($params);

		$dbtype = ucfirst($dbtype);
		$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";

		// Create the database connection
		$db =  ! empty($params->user)
			? new $driver($dsn, $params->user, $params->pass, $options)
			: new $driver($dsn, '', '', $options);

		// Set the table prefix, if it exists
		if (isset($params->prefix))
		{
			$db->setTablePrefix($params->prefix);
		}

		// Create Query Builder object
		$conn = new QueryBuilder($db, new QueryParser($db));


		// Save it for later
		if (isset($params->alias))
		{
			$this->connections[$params->alias] = $conn;
		}
		else
		{
			$this->connections[] = $conn;
		}

		return $conn;
	}
public function connect(\stdClass $params): QueryBuilderInterface
	{
		list($dsn, $dbtype, $params, $options) = $this->parseParams($params);

		$dbtype = ucfirst($dbtype);
		$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";

		// Create the database connection
		$db =  ! empty($params->user)
			? new $driver($dsn, $params->user, $params->pass, $options)
			: new $driver($dsn, '', '', $options);

		// Set the table prefix, if it exists
		if (isset($params->prefix))
		{
			$db->setTablePrefix($params->prefix);
		}

		// Create Query Builder object
		$conn = new QueryBuilder($db, new QueryParser($db));


		// Save it for later
		if (isset($params->alias))
		{
			$this->connections[$params->alias] = $conn;
		}
		else
		{
			$this->connections[] = $conn;
		}

		return $conn;
	}
public function connect ( \ stdClass $ params ) : QueryBuilderInterface { list ( $ dsn , $ dbtype , $ params , $ options ) = $ this -> parseParams ( $ params ) ; $ dbtype = ucfirst ( $ dbtype ) ; $ driver = "\\Query\\Drivers\\{$dbtype}\\Driver" ; // Create the database connection $ db = ! empty ( $ params -> user ) ? new $ driver ( $ dsn , $ params -> user , $ params -> pass , $ options ) : new $ driver ( $ dsn , '' , '' , $ options ) ; // Set the table prefix, if it exists if ( isset ( $ params -> prefix ) ) { $ db -> setTablePrefix ( $ params -> prefix ) ; } // Create Query Builder object $ conn = new QueryBuilder ( $ db , new QueryParser ( $ db ) ) ; // Save it for later if ( isset ( $ params -> alias ) ) { $ this -> connections [ $ params -> alias ] = $ conn ; } else { $ this -> connections [ ] = $ conn ; } return $ conn ; }
Parse the passed parameters and return a connection

@param \stdClass $params
@return QueryBuilderInterface
Parse the passed parameters and return a connection