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}'`)
|
res.push(`${tkey} <= '${val}'`)
|
||||||
break
|
break
|
||||||
case '$in':
|
case '$in':
|
||||||
res.push(
|
switch (type) {
|
||||||
type !== 'common'
|
case 'common':
|
||||||
? `${tkey} ?| array[${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'}]`
|
res.push(`${tkey} IN (${val.length > 0 ? val.map((v: any) => `'${v}'`).join(', ') : 'NULL'})`)
|
||||||
: `${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
|
break
|
||||||
case '$nin':
|
case '$nin':
|
||||||
if (val.length > 0) {
|
if (val.length > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user