Skip to content

Commit

Permalink
feat(collate): only collate if locale is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-vogel committed Mar 5, 2025
1 parent dc1b458 commit 1e1d589
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hana/lib/HANAService.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ SELECT ${mixing} FROM JSON_TABLE(SRC.JSON, '$' COLUMNS(${extraction})) AS NEW LE
localized
? c =>
this.expr(c) +
(c.element?.[this.class._localized]
(c.element?.[this.class._localized] && this.context.locale
? ` COLLATE ${collations[this.context.locale] || collations[this.context.locale.split('_')[0]] || collations['']
}`
: '') +
Expand Down
2 changes: 1 addition & 1 deletion postgres/lib/PostgresService.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ GROUP BY k
localized
? c =>
this.expr(c) +
(c.element?.[this.class._localized] ? ` COLLATE "${locale}"` : '') +
(c.element?.[this.class._localized] && locale ? ` COLLATE "${locale}"` : '') +
(c.sort?.toLowerCase() === 'desc' || c.sort === -1 ? ' DESC NULLS LAST' : ' ASC NULLS FIRST')
: c => this.expr(c) + (c.sort?.toLowerCase() === 'desc' || c.sort === -1 ? ' DESC NULLS LAST' : ' ASC NULLS FIRST'),
)
Expand Down

0 comments on commit 1e1d589

Please sign in to comment.