Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H2: Set collation #1502

Merged
merged 4 commits into from
Jan 22, 2025
Merged

H2: Set collation #1502

merged 4 commits into from
Jan 22, 2025

Conversation

MattSchur
Copy link
Contributor

No description provided.

@MattSchur MattSchur requested a review from smahati as a code owner December 6, 2024 13:42
@MattSchur MattSchur requested a review from agoerler December 6, 2024 13:42

1. H2 only supports database level collation. Lexicographical sorting on character-based columns isn't supported.
1. H2 only supports database-level collation. The default sort order is by ASCII-code, for dictionary order set a [collation](https://www.h2database.com/html/commands.html#set_collation).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should document in the H2 config section https://pages.github.tools.sap/cap/docs/java/cqn-services/persistence-services#h2

how to configure this URL in the application.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like

---
spring:
  config.activate.on-profile: local
  datasource:
    url: jdbc:h2:./test;COLLATION='ENGLISH'

or add SET COLLATION ENGLISH to the schema.sql

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or add SET COLLATION ENGLISH to the schema.sql

This could be done by the CDS Compiler :-). Might be a quick win.

java/cqn-services/persistence-services.md Outdated Show resolved Hide resolved
java/cqn-services/persistence-services.md Outdated Show resolved Hide resolved
@agoerler agoerler added this pull request to the merge queue Jan 22, 2025
Merged via the queue into main with commit 15a2d1b Jan 22, 2025
4 checks passed
@agoerler agoerler deleted the h2-collation branch January 22, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants