Skip to content

Commit a5f11b1

Browse files
authored
Fix mixin projection (#9287)
Signed-off-by: Denis Bykhov <[email protected]>
1 parent baef5c2 commit a5f11b1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

server/postgres/src/storage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ abstract class PostgresAdapterBase implements DbAdapter {
766766
if (attr !== undefined && this.hierarchy.isMixin(attr.attributeOf)) {
767767
const newKey = `${attr.attributeOf}.${attr.name}` as keyof Projection<T>
768768
res[newKey] = escape(projection[key])
769+
} else {
770+
;(res as any)[escape(key)] = escape(projection[key])
769771
}
770772
} catch (err: any) {
771773
// ignore, if

server/postgres/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ export interface JoinProps {
661661
export function escape<T> (str: T): T {
662662
if (typeof str === 'string') {
663663
// Remove all characters except a-z, A-Z, 0-9 and _ .
664-
return str.replace(/[^a-zA-Z0-9_.]/g, '') as T
664+
return str.replace(/[^a-zA-Z0-9_.:]/g, '') as T
665665
}
666666
return str
667667
}

0 commit comments

Comments
 (0)