Skip to content

Commit 5fd288c

Browse files
pg?
1 parent f70c98f commit 5fd288c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/malloy/src/dialect/postgres/postgres.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,16 +449,16 @@ export class PostgresDialect extends PostgresBase {
449449
}
450450

451451
sqlLiteralRecord(lit: RecordLiteralNode): string {
452-
const props: string[] = [];
452+
const props = {};
453453
for (const [kName, kVal] of Object.entries(lit.kids)) {
454-
props.push(`"${kName}": ${JSON.stringify(kVal.sql)}`);
454+
props[kName] = kVal.sql;
455455
}
456-
return `{${props.join(',')}}::jsonb`;
456+
return `'${JSON.stringify(props)}'::jsonb`;
457457
}
458458

459459
sqlLiteralArray(lit: ArrayLiteralNode): string {
460460
// mtoy todo real quoting of values ... strings with quotes will break thi
461461
const array = lit.kids.values.map(val => val.sql);
462-
return `'[${array.join(',')}]'::jsonb`;
462+
return `'${JSON.stringify(array)}'::jsonb`;
463463
}
464464
}

0 commit comments

Comments
 (0)