mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Test setting of schema name
This commit is contained in:
parent
1414f8979c
commit
93af381436
2 changed files with 10 additions and 6 deletions
|
@ -76,7 +76,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
"SET statement_timeout = '$timeout'",
|
"SET statement_timeout = '$timeout'",
|
||||||
];
|
];
|
||||||
if (strlen($schema) > 0) {
|
if (strlen($schema) > 0) {
|
||||||
$out[] = 'SET search_path = \'"'.str_replace('"', '""', $schema).'", "$user", public\'';
|
$schema = '"'.str_replace('"', '""', $schema).'"';
|
||||||
|
$out[] = "SET search_path = $schema, public";
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
@ -92,11 +93,6 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function driverName(): string {
|
|
||||||
return Arsse::$lang->msg("Driver.Db.PostgreSQL.Name");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function schemaID(): string {
|
public static function schemaID(): string {
|
||||||
return "PostgreSQL";
|
return "PostgreSQL";
|
||||||
}
|
}
|
||||||
|
@ -150,11 +146,18 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @codeCoverageIgnore */
|
||||||
|
public static function driverName(): string {
|
||||||
|
return Arsse::$lang->msg("Driver.Db.PostgreSQL.Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @codeCoverageIgnore */
|
||||||
public static function requirementsMet(): bool {
|
public static function requirementsMet(): bool {
|
||||||
// stub: native interface is not yet supported
|
// stub: native interface is not yet supported
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @codeCoverageIgnore */
|
||||||
protected function makeConnection(string $user, string $pass, string $db, string $host, int $port, string $service) {
|
protected function makeConnection(string $user, string $pass, string $db, string $host, int $port, string $service) {
|
||||||
// stub: native interface is not yet supported
|
// stub: native interface is not yet supported
|
||||||
throw new \Exception;
|
throw new \Exception;
|
||||||
|
|
|
@ -47,6 +47,7 @@ abstract class AbstractTest extends \PHPUnit\Framework\TestCase {
|
||||||
'dbPostgreSQLUser' => "arsse_test",
|
'dbPostgreSQLUser' => "arsse_test",
|
||||||
'dbPostgreSQLPass' => "arsse_test",
|
'dbPostgreSQLPass' => "arsse_test",
|
||||||
'dbPostgreSQLDb' => "arsse_test",
|
'dbPostgreSQLDb' => "arsse_test",
|
||||||
|
'dbPostgreSQLSchema' => "arsse_test",
|
||||||
];
|
];
|
||||||
Arsse::$conf = ($force ? null : Arsse::$conf) ?? (new Conf)->import($defaults)->import($conf);
|
Arsse::$conf = ($force ? null : Arsse::$conf) ?? (new Conf)->import($defaults)->import($conf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue