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:
parent
908e1fa310
commit
ad8057a40b
4 changed files with 18 additions and 0 deletions
|
@ -73,6 +73,10 @@ interface Driver {
|
||||||
*
|
*
|
||||||
* - "greatest": the GREATEST function implemented by PostgreSQL and MySQL
|
* - "greatest": the GREATEST function implemented by PostgreSQL and MySQL
|
||||||
* - "nocase": the name of a general-purpose case-insensitive collation sequence
|
* - "nocase": the name of a general-purpose case-insensitive collation sequence
|
||||||
|
* - "like": the case-insensitive LIKE operator
|
||||||
*/
|
*/
|
||||||
public function sqlToken(string $token): string;
|
public function sqlToken(string $token): string;
|
||||||
|
|
||||||
|
/** Indicates whether the implementation is capable of full-text searching */
|
||||||
|
public function fulltextEnabled(): bool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,4 +212,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
public function prepareArray(string $query, array $paramTypes): \JKingWeb\Arsse\Db\Statement {
|
public function prepareArray(string $query, array $paramTypes): \JKingWeb\Arsse\Db\Statement {
|
||||||
return new Statement($this->db, $query, $paramTypes, $this->packetSize);
|
return new Statement($this->db, $query, $paramTypes, $this->packetSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function fulltextEnabled(): bool {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,6 +120,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
switch (strtolower($token)) {
|
switch (strtolower($token)) {
|
||||||
case "nocase":
|
case "nocase":
|
||||||
return '"und-x-icu"';
|
return '"und-x-icu"';
|
||||||
|
case "like":
|
||||||
|
return "ilike";
|
||||||
default:
|
default:
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
|
@ -219,4 +221,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
public function prepareArray(string $query, array $paramTypes): \JKingWeb\Arsse\Db\Statement {
|
public function prepareArray(string $query, array $paramTypes): \JKingWeb\Arsse\Db\Statement {
|
||||||
return new Statement($this->db, $query, $paramTypes);
|
return new Statement($this->db, $query, $paramTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function fulltextEnabled(): bool {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,4 +179,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
$this->exec((!$rollback) ? "COMMIT" : "ROLLBACK");
|
$this->exec((!$rollback) ? "COMMIT" : "ROLLBACK");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function fulltextEnabled(): bool {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue