mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-03 08:57:14 +03:00
Fix pg in query (#7207)
This commit is contained in:
parent
6971dea915
commit
98bb4fe0ef
@ -1002,11 +1002,17 @@ abstract class PostgresAdapterBase implements DbAdapter {
|
||||
res.push(`${tkey} <= '${val}'`)
|
||||
break
|
||||
case '$in':
|
||||
res.push(
|
||||
type !== 'common'
|
||||
? `${tkey} ?| array[${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'}]`
|
||||
: `${tkey} IN (${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'})`
|
||||
)
|
||||
switch (type) {
|
||||
case 'common':
|
||||
res.push(`${tkey} IN (${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'})`)
|
||||
break
|
||||
case 'array':
|
||||
res.push(`${tkey} && array[${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'}]`)
|
||||
break
|
||||
case 'dataArray':
|
||||
res.push(`${tkey} ?| array[${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'}]`)
|
||||
break
|
||||
}
|
||||
break
|
||||
case '$nin':
|
||||
if (val.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user