Skip to content

Commit

Permalink
pg arrays almost
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoy-googly-moogly committed Nov 29, 2024
1 parent 26d1b29 commit 27feb85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/malloy/src/dialect/postgres/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@ export class PostgresDialect extends PostgresBase {
}

sqlLiteralArray(lit: ArrayLiteralNode): string {
// mtoy todo real quoting of values ... strings with quotes will break thi
const array = lit.kids.values.map(val => val.sql);
return `'${JSON.stringify(array)}'::jsonb`;
return `ARRAY[${array.join(',')}]`;
}
}
2 changes: 1 addition & 1 deletion test/src/databases/all/compound-atomic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe.each(runtimes.runtimeList)(
const nameOfArrayLenFunction = {
'duckdb': 'LEN',
'standardsql': 'ARRAY_LENGTH',
'postgres': 'JSONB_ARRAY_LENGTH',
'postgres': 'CARDINALITY',
'presto': 'CARDINALITY',
'trino': 'CARDINALITY',
'mysql': 'JSON_LENGTH',
Expand Down

0 comments on commit 27feb85

Please sign in to comment.