{-# LANGUAGE
DataKinds
, OverloadedStrings
, TypeOperators
#-}
module Squeal.PostgreSQL.Expression.TextSearch
(
(@@)
, (.&)
, (.|)
, (.!)
, (<->)
, arrayToTSvector
, tsvectorLength
, numnode
, plainToTSquery
, phraseToTSquery
, websearchToTSquery
, queryTree
, toTSquery
, toTSvector
, setWeight
, strip
, jsonToTSvector
, jsonbToTSvector
, tsDelete
, tsFilter
, tsHeadline
) where
import Squeal.PostgreSQL.Expression
import Squeal.PostgreSQL.Type.List
import Squeal.PostgreSQL.Type.Schema
(@@) :: Operator (null 'PGtsvector) (null 'PGtsquery) ('Null 'PGbool)
@@ :: Expression grp lat with db params from (null 'PGtsvector)
-> Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from ('Null 'PGbool)
(@@) = ByteString
-> Operator (null 'PGtsvector) (null 'PGtsquery) ('Null 'PGbool)
forall (ty0 :: NullType) (ty1 :: NullType) (ty2 :: NullType).
ByteString -> Operator ty0 ty1 ty2
unsafeBinaryOp ByteString
"@@"
(.&) :: Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery)
.& :: Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtsquery)
(.&) = ByteString
-> Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery)
forall (ty0 :: NullType) (ty1 :: NullType) (ty2 :: NullType).
ByteString -> Operator ty0 ty1 ty2
unsafeBinaryOp ByteString
"&&"
(.|) :: Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery)
.| :: Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtsquery)
(.|) = ByteString
-> Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery)
forall (ty0 :: NullType) (ty1 :: NullType) (ty2 :: NullType).
ByteString -> Operator ty0 ty1 ty2
unsafeBinaryOp ByteString
"||"
(.!) :: null 'PGtsquery --> null 'PGtsquery
.! :: Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtsquery)
(.!) = ByteString -> null 'PGtsquery --> null 'PGtsquery
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeLeftOp ByteString
"!!"
(<->) :: Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery)
<-> :: Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtsquery)
(<->) = ByteString
-> Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery)
forall (ty0 :: NullType) (ty1 :: NullType) (ty2 :: NullType).
ByteString -> Operator ty0 ty1 ty2
unsafeBinaryOp ByteString
"<->"
arrayToTSvector
:: null ('PGvararray ('NotNull 'PGtext))
--> null 'PGtsvector
arrayToTSvector :: Expression
grp lat with db params from (null ('PGvararray ('NotNull 'PGtext)))
-> Expression grp lat with db params from (null 'PGtsvector)
arrayToTSvector = ByteString
-> null ('PGvararray ('NotNull 'PGtext)) --> null 'PGtsvector
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"array_to_tsvector"
tsvectorLength :: null 'PGtsvector --> null 'PGint4
tsvectorLength :: Expression grp lat with db params from (null 'PGtsvector)
-> Expression grp lat with db params from (null 'PGint4)
tsvectorLength = ByteString -> null 'PGtsvector --> null 'PGint4
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"length"
numnode :: null 'PGtsquery --> null 'PGint4
numnode :: Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGint4)
numnode = ByteString -> null 'PGtsquery --> null 'PGint4
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"numnode"
plainToTSquery :: null 'PGtext --> null 'PGtsquery
plainToTSquery :: Expression grp lat with db params from (null 'PGtext)
-> Expression grp lat with db params from (null 'PGtsquery)
plainToTSquery = ByteString -> null 'PGtext --> null 'PGtsquery
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"plainto_tsquery"
phraseToTSquery :: null 'PGtext --> null 'PGtsquery
phraseToTSquery :: Expression grp lat with db params from (null 'PGtext)
-> Expression grp lat with db params from (null 'PGtsquery)
phraseToTSquery = ByteString -> null 'PGtext --> null 'PGtsquery
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"phraseto_tsquery"
websearchToTSquery :: null 'PGtext --> null 'PGtsquery
websearchToTSquery :: Expression grp lat with db params from (null 'PGtext)
-> Expression grp lat with db params from (null 'PGtsquery)
websearchToTSquery = ByteString -> null 'PGtext --> null 'PGtsquery
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"websearch_to_tsquery"
queryTree :: null 'PGtsquery --> null 'PGtext
queryTree :: Expression grp lat with db params from (null 'PGtsquery)
-> Expression grp lat with db params from (null 'PGtext)
queryTree = ByteString -> null 'PGtsquery --> null 'PGtext
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"query_tree"
toTSquery :: null 'PGtext --> null 'PGtsquery
toTSquery :: Expression grp lat with db params from (null 'PGtext)
-> Expression grp lat with db params from (null 'PGtsquery)
toTSquery = ByteString -> null 'PGtext --> null 'PGtsquery
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"to_tsquery"
toTSvector
:: ty `In` '[ 'PGtext, 'PGjson, 'PGjsonb]
=> null ty --> null 'PGtsvector
toTSvector :: null ty --> null 'PGtsvector
toTSvector = ByteString -> null ty --> null 'PGtsvector
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"to_tsvector"
setWeight :: '[null 'PGtsvector, null ('PGchar 1)] ---> null 'PGtsvector
setWeight :: NP
(Expression grp lat with db params from)
'[null 'PGtsvector, null ('PGchar 1)]
-> Expression grp lat with db params from (null 'PGtsvector)
setWeight = ByteString
-> '[null 'PGtsvector, null ('PGchar 1)] ---> null 'PGtsvector
forall (xs :: [NullType]) (y :: NullType).
SListI xs =>
ByteString -> xs ---> y
unsafeFunctionN ByteString
"set_weight"
strip :: null 'PGtsvector --> null 'PGtsvector
strip :: Expression grp lat with db params from (null 'PGtsvector)
-> Expression grp lat with db params from (null 'PGtsvector)
strip = ByteString -> null 'PGtsvector --> null 'PGtsvector
forall (x :: NullType) (y :: NullType). ByteString -> x --> y
unsafeFunction ByteString
"strip"
jsonToTSvector :: '[null 'PGjson, null 'PGjson] ---> null 'PGtsvector
jsonToTSvector :: NP
(Expression grp lat with db params from)
'[null 'PGjson, null 'PGjson]
-> Expression grp lat with db params from (null 'PGtsvector)
jsonToTSvector = ByteString -> '[null 'PGjson, null 'PGjson] ---> null 'PGtsvector
forall (xs :: [NullType]) (y :: NullType).
SListI xs =>
ByteString -> xs ---> y
unsafeFunctionN ByteString
"json_to_tsvector"
jsonbToTSvector :: '[null 'PGjsonb, null 'PGjsonb] ---> null 'PGtsvector
jsonbToTSvector :: NP
(Expression grp lat with db params from)
'[null 'PGjsonb, null 'PGjsonb]
-> Expression grp lat with db params from (null 'PGtsvector)
jsonbToTSvector = ByteString -> '[null 'PGjsonb, null 'PGjsonb] ---> null 'PGtsvector
forall (xs :: [NullType]) (y :: NullType).
SListI xs =>
ByteString -> xs ---> y
unsafeFunctionN ByteString
"jsonb_to_tsvector"
tsDelete ::
'[null 'PGtsvector, null ('PGvararray ('NotNull 'PGtext))]
---> null 'PGtsvector
tsDelete :: NP
(Expression grp lat with db params from)
'[null 'PGtsvector, null ('PGvararray ('NotNull 'PGtext))]
-> Expression grp lat with db params from (null 'PGtsvector)
tsDelete = ByteString
-> '[null 'PGtsvector, null ('PGvararray ('NotNull 'PGtext))]
---> null 'PGtsvector
forall (xs :: [NullType]) (y :: NullType).
SListI xs =>
ByteString -> xs ---> y
unsafeFunctionN ByteString
"ts_delete"
tsFilter ::
'[null 'PGtsvector, null ('PGvararray ('NotNull ('PGchar 1)))]
---> null 'PGtsvector
tsFilter :: NP
(Expression grp lat with db params from)
'[null 'PGtsvector, null ('PGvararray ('NotNull ('PGchar 1)))]
-> Expression grp lat with db params from (null 'PGtsvector)
tsFilter = ByteString
-> '[null 'PGtsvector, null ('PGvararray ('NotNull ('PGchar 1)))]
---> null 'PGtsvector
forall (xs :: [NullType]) (y :: NullType).
SListI xs =>
ByteString -> xs ---> y
unsafeFunctionN ByteString
"ts_filter"
tsHeadline
:: document `In` '[ 'PGtext, 'PGjson, 'PGjsonb]
=> '[null document, null 'PGtsquery] ---> null 'PGtext
tsHeadline :: '[null document, null 'PGtsquery] ---> null 'PGtext
tsHeadline = ByteString -> '[null document, null 'PGtsquery] ---> null 'PGtext
forall (xs :: [NullType]) (y :: NullType).
SListI xs =>
ByteString -> xs ---> y
unsafeFunctionN ByteString
"ts_headline"