File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/malloy/src/dialect/postgres Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -449,16 +449,16 @@ export class PostgresDialect extends PostgresBase {
449
449
}
450
450
451
451
sqlLiteralRecord ( lit : RecordLiteralNode ) : string {
452
- const props : string [ ] = [ ] ;
452
+ const props = { } ;
453
453
for ( const [ kName , kVal ] of Object . entries ( lit . kids ) ) {
454
- props . push ( `" ${ kName } ": ${ JSON . stringify ( kVal . sql ) } ` ) ;
454
+ props [ kName ] = kVal . sql ;
455
455
}
456
- return `{ ${ props . join ( ',' ) } } ::jsonb` ;
456
+ return `' ${ JSON . stringify ( props ) } ' ::jsonb` ;
457
457
}
458
458
459
459
sqlLiteralArray ( lit : ArrayLiteralNode ) : string {
460
460
// mtoy todo real quoting of values ... strings with quotes will break thi
461
461
const array = lit . kids . values . map ( val => val . sql ) ;
462
- return `'[ ${ array . join ( ',' ) } ] '::jsonb` ;
462
+ return `'${ JSON . stringify ( array ) } '::jsonb` ;
463
463
}
464
464
}
You can’t perform that action at this time.
0 commit comments