This method actually returns a Schema object that was named in the connection string or NULL
<?php
$session = mysql_xdevapi\getSession('mysqlzx://dbuser:654321@mysql:33060/dbname');
/** @var Schema $defaultSchema */
$defaultSchema = $session->getDefaultSchema();
print "<pre>";
print_r($defaultSchema);
?>
will output:
mysql_xdevapi\Schema Object
(
[name] => dbname
)