1- import { joinAny , joinMap , prepareAny } from "../../query/ast/IStringTransformer.js" ;
1+ import { expandParamArray , joinAny , joinMap , prepareAny } from "../../query/ast/IStringTransformer.js" ;
22import { NotSupportedError } from "../../query/parser/NotSupportedError.js" ;
33import Sql from "../../sql/Sql.js" ;
44import { ISqlHelpers , flattenMethods } from "../ISqlHelpers.js" ;
@@ -280,8 +280,12 @@ export const PostgreSqlHelper: ISqlHelpers = {
280280 iLike ( text , test ) {
281281 return prepareAny `(${ text } iLike ${ test } )` ;
282282 } ,
283- iLikeAny ( text , test ) {
284- return [ "(" , text , " iLIKE ANY (ARRAY[" , ( x ) => joinMap ( "," , x , test , ( item ) => [ ( ) => item ] ) , "]))" ] as any ;
283+ iLikeAny ( text , input ) {
284+ return expandParamArray ( {
285+ input,
286+ prefix : [ "(" , text , " iLIKE ANY (ARRAY[" ] ,
287+ suffix : [ "]))" ]
288+ } ) ;
285289 } ,
286290 indexOf ( text , test ) {
287291 return prepareAny `(strpos(${ text } , ${ test } ) - 1)` ;
@@ -295,8 +299,12 @@ export const PostgreSqlHelper: ISqlHelpers = {
295299 like ( text , test ) {
296300 return prepareAny `(${ text } LIKE ${ test } )` ;
297301 } ,
298- likeAny ( text , test ) {
299- return [ "(" , text , " LIKE ANY (ARRAY[" , ( x ) => joinMap ( "," , x , test , ( item ) => [ ( ) => item ] ) , "]))" ] as any ;
302+ likeAny ( text , input ) {
303+ return expandParamArray ( {
304+ input,
305+ prefix : [ "(" , text , " LIKE ANY (ARRAY[" ] ,
306+ suffix : [ "]))" ]
307+ } ) ;
300308 } ,
301309 lower ( text ) {
302310 return prepareAny `LOWER(${ text } )` ;
0 commit comments