Skip to content

Comments

H2: Set collation#1502

Merged
agoerler merged 4 commits intomainfrom
h2-collation
Jan 22, 2025
Merged

H2: Set collation#1502
agoerler merged 4 commits intomainfrom
h2-collation

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
[H2](https://www.h2database.com/html/main.html) is the recommended in-memory databases for local development and testing with CAP Java. There's no production support for H2 from CAP and there are the following limitations:

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.

@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
@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