1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Driver changes to support basic text searching

This commit is contained in:
J. King 2019-02-22 11:13:13 -05:00
parent 908e1fa310
commit ad8057a40b
4 changed files with 18 additions and 0 deletions

View file

@ -73,6 +73,10 @@ interface Driver {
*
* - "greatest": the GREATEST function implemented by PostgreSQL and MySQL
* - "nocase": the name of a general-purpose case-insensitive collation sequence
* - "like": the case-insensitive LIKE operator
*/
public function sqlToken(string $token): string;
/** Indicates whether the implementation is capable of full-text searching */
public function fulltextEnabled(): bool;
}

View file

@ -212,4 +212,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
public function prepareArray(string $query, array $paramTypes): \JKingWeb\Arsse\Db\Statement {
return new Statement($this->db, $query, $paramTypes, $this->packetSize);
}
public function fulltextEnabled(): bool {
return false;
}
}

View file

@ -120,6 +120,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
switch (strtolower($token)) {
case "nocase":
return '"und-x-icu"';
case "like":
return "ilike";
default:
return $token;
}
@ -219,4 +221,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
public function prepareArray(string $query, array $paramTypes): \JKingWeb\Arsse\Db\Statement {
return new Statement($this->db, $query, $paramTypes);
}
public function fulltextEnabled(): bool {
return false;
}
}

View file

@ -179,4 +179,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
$this->exec((!$rollback) ? "COMMIT" : "ROLLBACK");
return true;
}
public function fulltextEnabled(): bool {
return false;
}
}