Skip to content

Commit

Permalink
Merge pull request #8 from makise-co/feature/support-newer-version-of…
Browse files Browse the repository at this point in the history
…-spiral-db

Support newer version of Spiral Database
  • Loading branch information
codercms authored Sep 24, 2021
2 parents 4874467 + 248165e commit 352a6d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Driver/MakisePostgres/MakisePostgresDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ class MakisePostgresDriver implements DriverInterface, LoggerAwareInterface
'queryCache' => true,

// disable schema modifications
'readonlySchema' => false
'readonlySchema' => false,

// disable write expressions
'readonly' => false,
];

private ?Connection $connection = null;
Expand Down Expand Up @@ -214,6 +217,14 @@ public function __call(string $name, array $arguments)
throw new DriverException("Undefined driver method `{$name}`");
}

/**
* {@inheritdoc}
*/
public function isReadonly(): bool
{
return (bool)($this->options['readonly'] ?? false);
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -804,4 +815,4 @@ protected function getDSN(): string
{
return $this->config->getConnectionString();
}
}
}
8 changes: 8 additions & 0 deletions src/Driver/MakisePostgres/PooledMakisePostgresDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ public function getPool(): Bridge\PostgresPool
return $this->pool;
}

/**
* {@inheritdoc}
*/
public function isReadonly(): bool
{
return (bool)($this->options['readonly'] ?? false);
}

public function getType(): string
{
return 'MakisePostgresPool';
Expand Down

0 comments on commit 352a6d3

Please sign in to comment.