Skip to content
Merged
95 changes: 52 additions & 43 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 39 additions & 3 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
abstract class Adapter
{
protected string $database = '';
protected string $hostname = '';

protected string $namespace = '';

Expand Down Expand Up @@ -79,15 +80,15 @@ public function resetDebug(): static
*
* @param string $namespace
*
* @return bool
* @return $this
* @throws DatabaseException
*
*/
public function setNamespace(string $namespace): bool
public function setNamespace(string $namespace): static
{
$this->namespace = $this->filter($namespace);

return true;
return $this;
}

/**
Expand All @@ -103,6 +104,29 @@ public function getNamespace(): string
return $this->namespace;
}

/**
* Set Hostname.
*
* @param string $hostname
* @return $this
*/
public function setHostname(string $hostname): static
{
$this->hostname = $hostname;

return $this;
}

/**
* Get Hostname.
*
* @return string
*/
public function getHostname(): string
{
return $this->hostname;
}

/**
* Set Database.
*
Expand Down Expand Up @@ -950,8 +974,20 @@ abstract public function getSupportForUpserts(): bool;
*/
abstract public function getSupportForCacheSkipOnFailure(): bool;

/**
* Is reconnection supported?
*
* @return bool
*/
abstract public function getSupportForReconnection(): bool;

/**
* Is hostname supported?
*
* @return bool
*/
abstract public function getSupportForHostname(): bool;

/**
* Get current attribute count from collection document
*
Expand Down
5 changes: 5 additions & 0 deletions src/Database/Adapter/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ public function getSupportForReconnection(): bool
return $this->delegate(__FUNCTION__, \func_get_args());
}

public function getSupportForHostname(): bool
{
return $this->delegate(__FUNCTION__, \func_get_args());
}

public function getCountOfAttributes(Document $collection): int
{
return $this->delegate(__FUNCTION__, \func_get_args());
Expand Down
Loading