mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-22 19:38:17 +00:00
Fix pg escape (#7187)
Some checks are pending
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
5353a06b07
commit
641e72fc0d
@ -484,7 +484,7 @@ abstract class PostgresAdapterBase implements DbAdapter {
|
||||
const key = domain === DOMAIN_SPACE ? '_id' : domain === DOMAIN_TX ? "data ->> 'objectSpace'" : 'space'
|
||||
const privateCheck = domain === DOMAIN_SPACE ? ' OR sec.private = false' : ''
|
||||
const q = `(sec.members @> '{"${acc._id}"}' OR sec."_class" = '${core.class.SystemSpace}'${privateCheck})`
|
||||
return `INNER JOIN ${translateDomain(DOMAIN_SPACE)} AS sec ON sec._id = ${domain}.${key} AND sec."workspaceId" = '${this.workspaceId.name}' AND ${q}`
|
||||
return `INNER JOIN ${translateDomain(DOMAIN_SPACE)} AS sec ON sec._id = ${domain}.${escapeBackticks(key)} AND sec."workspaceId" = '${this.workspaceId.name}' AND ${q}`
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1019,7 +1019,7 @@ abstract class PostgresAdapterBase implements DbAdapter {
|
||||
res.push(`${tkey} IS ${val === true ? 'NOT NULL' : 'NULL'}`)
|
||||
break
|
||||
case '$regex':
|
||||
res.push(`${tkey} SIMILAR TO '${val}'`)
|
||||
res.push(`${tkey} SIMILAR TO '${escapeBackticks(val)}'`)
|
||||
break
|
||||
case '$options':
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user