This is an automated email from the ASF dual-hosted git repository.

derjan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git


The following commit(s) were added to refs/heads/master by this push:
     new 86624c4a EMPIREDB-397
86624c4a is described below

commit 86624c4a78c3fa9c8581c6399e30abaef1b21e52
Author: Jan Glaubitz <[email protected]>
AuthorDate: Wed Oct 19 08:39:09 2022 +0200

    EMPIREDB-397
    
    - Add support for websearch_to_tsquery
---
 .../apache/empire/dbms/postgresql/DBCommandPostgres.java    |  8 ++++++++
 .../apache/empire/dbms/postgresql/PostgresSqlPhrase.java    | 13 +++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git 
a/empire-db/src/main/java/org/apache/empire/dbms/postgresql/DBCommandPostgres.java
 
b/empire-db/src/main/java/org/apache/empire/dbms/postgresql/DBCommandPostgres.java
index 9df31f65..b6fb8f7c 100644
--- 
a/empire-db/src/main/java/org/apache/empire/dbms/postgresql/DBCommandPostgres.java
+++ 
b/empire-db/src/main/java/org/apache/empire/dbms/postgresql/DBCommandPostgres.java
@@ -90,6 +90,14 @@ public class DBCommandPostgres extends DBCommand
         return new PostgresFuncExpr(expr, PostgresSqlPhrase.PLAINTO_TSQUERY, 
null, DataType.UNKNOWN);
     }
     
+    /**
+     * See https://www.postgresql.org/docs/current/textsearch-controls.html
+     */
+    public DBColumnExpr pgWebsearchToTsquery(DBColumnExpr expr)
+    {
+        return new PostgresFuncExpr(expr, 
PostgresSqlPhrase.WEBSEARCH_TO_TSQUERY, null, DataType.UNKNOWN);
+    }
+    
     /**
      * See https://www.postgresql.org/docs/current/textsearch-controls.html
      */
diff --git 
a/empire-db/src/main/java/org/apache/empire/dbms/postgresql/PostgresSqlPhrase.java
 
b/empire-db/src/main/java/org/apache/empire/dbms/postgresql/PostgresSqlPhrase.java
index 8dd79ca5..599db77e 100644
--- 
a/empire-db/src/main/java/org/apache/empire/dbms/postgresql/PostgresSqlPhrase.java
+++ 
b/empire-db/src/main/java/org/apache/empire/dbms/postgresql/PostgresSqlPhrase.java
@@ -25,12 +25,13 @@ package org.apache.empire.dbms.postgresql;
 public enum PostgresSqlPhrase
 {
     // functions
-    AGE             ("AGE(?)"),
-    AGE_BETWEEN     ("AGE(?, {0})"),
-    EXTRACT         ("EXTRACT({0:*} FROM ?)"),  // :* is important!
-    TO_TSQUERY      ("to_tsquery(?)"),
-    TO_TSVECTOR     ("to_tsvector(?)"),
-    PLAINTO_TSQUERY ("plainto_tsquery(?)");
+    AGE                  ("AGE(?)"),
+    AGE_BETWEEN          ("AGE(?, {0})"),
+    EXTRACT              ("EXTRACT({0:*} FROM ?)"),  // :* is important!
+    TO_TSQUERY           ("to_tsquery(?)"),
+    TO_TSVECTOR          ("to_tsvector(?)"),
+    PLAINTO_TSQUERY      ("plainto_tsquery(?)"),
+       WEBSEARCH_TO_TSQUERY ("websearch_to_tsquery(?)");
 
     private final String functionSQL;
     private final boolean aggregate;

Reply via email to